It’d be easy to gate this: require that the iOS device be connected to a Mac and a special app used to change “advanced” settings. These could include side loading, the ability to install alternate app stores, and low level OS access of various kinds.
It would be very helpful to developers and debugging too.
So why do you think Apple doesn't want that to happen?
Surely a developer or ten has suggested the same thing by now?
My guess is focus: they are 100% focused on being the best closed platform that is easy to use and everything is handled for the user. A lively sideloading and 3rd party homebrew scene would be a massive distraction for the Dev team and most importantly the support side with little direct business ROI (indirect could be big but a harder sell).
Possibly harming brand reputation showing people what they could have absent the paid wall. When the alternative exposes people to risk, and they'd rather not have to explain themselves?
That's like say "why does cancer happen?" "because your cells will die"
Well obviously that's the most basic reason why but that doesn't help us solve the problem.
How exactly does it cause a loss in revenue? It's very possible the benefits that come from being more open improve the platform for everyone and increase sales. So it's valuable to be very specific on where the costs are.
It would be very helpful to developers and debugging too.