Say you were hired to create education software that will be sold to students of a particular academic institution. You are the only developer working on this project and have written all of the code. An open source alternative to the project has the potential of benefiting underprivileged students from around the world. In short, a free alternative would contribute to the greater good of humanity. Would it be "OK" to create an open source alternative to the software that you are being paid to develop?
P.S. The software will only be used by the students of the institution. There are no plans to distribute it commercially. The application does not make use of other people's intellectual property.