Obviously Apple is allowed to charge a fee. The App Store costs serious money to run -- to develop, maintain, support.
But when the App Store is the only place apps can be published for iOS, and more than half of worldwide mobile app revenue is made there, there's no competition.
Nobody else can go and create their own separate iOS App Store with lower commissions. But the kicker is, there is a real consumer benefit to that -- the entire iOS world is built on a premise of security and privacy that only comes from having everything locked down and controlled by Apple, from a secure enclave to approved apps.
There are really only two solutions here:
1) Legislation to define this as a special kind of monopoly situation (a new definition of monopoly, at least in the US) and create some kind of profit cap where Apple isn't allowed to charge more than x% over revenue. But which feels pretty icky -- the government stepping in to tell you you're not allowed to maximize profit like any other business. And what's the legal basis for deciding whether the "allowed profit" is 5% or 50%? 10% or 12%? 0% or 100%? You can invent an argument for any number you want, but ultimately it's entirely arbitrary.
2) Legislation to require Apple, Google, Microsoft, and all OS's generally to allow third-party fully-integrated app stores. But which will obviously do serious damage to the reputation of the iPhone (and mobile devices generally), when people start to associate them with buggy malware apps that drain your battery and use dark UX patterns to trick you into giving them all your location, microphone, etc. permissions.
But both seem pretty gross, totally non-market, government-intervention. But Apple's 30% cut is also pretty gross at this point.
It sucks there's just no obvious, elegant, good solution here.