That wouldn't be open source. OSI includes the clause "No Discrimination Against Fields of Endeavor"[0] for its definition of open source. Famously, the JSON license[1] has a clause "The Software shall be used for Good, not Evil," so the Free Software Foundation considers it nonfree.[2]
[0]: https://opensource.org/osd
[1]: https://www.json.org/license.html
[2]: https://www.gnu.org/licenses/license-list.en.html#JSON