The JSON license is what you are looking for. It has the appearance of a general permissive open license with one additional line in it:
The Software shall be used for Good, not Evil.
This has caused numerous problems. It has made it so that it needs a special license grant for various Three Letter Companies (cough IBM cough). You can read about it at IBM and its minions … in which they author gave a grant that IBM can't really be sure that their users aren't doing evil, but they'd really like to distribute JSON.
Of course. So I wrote back – this happened literally two weeks ago – “I give permission for IBM, its customers, partners, and minions, to use JSLint for evil.”
There are also class that it was removed from Google Code back in the day because it wasn't a free license.
Similar works now are more simply licensed and suggestedto be used for good.
JShrink is licensed under the BSD License. See the LICENSE file for details.
In the spirit of open source, use of this library for evil is discouraged but not prohibited.
Lets look at that open source thing.
As described at The Open Source Definition
5. No Discrimination Against Persons or Groups
The license must not discriminate against any person or group of persons.
6. No Discrimination Against Fields of Endeavor
The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.
Thus, no. You can't say "evil people can't use this" and you can't say "you can't use it for evil" if you are using an open source license. It doesn't matter what it is or if you agree with it or not - you cannot restrict the software's usage if the software is to be licensed under an open source license.