You are right, but I cannot find a single example of such a ban actually being effective though. Information wants to be free and all that.
Of course Joe Sixpack can throw their code up anywhere, but Joe Corporation gets wrecked if they try to sell it.
https://developer.apple.com/documentation/security/complying...
For example, this is enforced by Apple Store.