There are programming projects[1] out there that use licenses to prevent people from using projects in ways the authors don't agree with. You could also argue that GPL does the same thing (prevents people from using/distributing the software in the way they would like).
Whether you consider it moral doesn't seem relevant, only to respect the wishes of the author of such programs.
[1] https://github.com/katharostech/bevy_retrograde/blob/master/...