It was sideloading that led to the creation of the app store to begin with, although more for profiteering and control than security. They literally just built an official version of Cydia.
I would argue that isn't the way Apple sees it. They would see it as someone else tried (successfully) to circumvent their devices/software controls to allow you to install software they did not authorize or originally intended to be on the device. They would view it as a security concern (not just about making profit off you). That if Cydia can work around the protections on the device. That means "others" way more motivated and even better funded can do worse.
They didn't build the device for Cydia to do with as they please. They built the device they wanted to build and sell to people. Future versions of which don't have to be so easily hacked around.
You do realise that sideloading on Android is actually only permissable by the user on an app-by-app basis? If you know what you're doing (and people who sideload apk files generally do) you have a file manager app like ZArchiver with the permission on so that if your browser does inadvertantly download an apk you are aware of it cannot install itself in the background because Chrome etc don't have permission to.
It will not be for long. New rules will require them to make this easier.
I'm not bashing the ability to do any side-loading on Android. I'm fine if you're fine with it on that platform. But the rules will make it WAY easier to perform these functions. Because the current restrictions can be interpreted as preventing the ability to install. In plan language the EU wants it to be as easy as it is on a PC/Mac to install software. Sure you may have a warning or two. But, you're not going to have to go to settings and allow this or that. It could be viewed as too much of a burden. And when many simply don't use this feature (as is currently the case). They will just tell Apple and Google to remove their respective stores from their devices. And your only want to get stuff is 3rd party (as it is on PC/Mac).
Sideloading is pretty great, actually. With it I can do things like get a port of the Google camera app for my phone, install the Pixel Watch watchfaces on another wearOS device, play Fortnite or perhaps even an older game since dumped by the Play Store. Not smaller titles either, things like Jet Set Radio or Soulcalibur. You can also roll things back to older updates via legit sites like APK mirror to avoid something a dev put in you don't like.
This is fine. Hence why I insist on repeating, just get an Android device. Do whatever you want there. And if the demand is so great for such a thing. Android will rule the world on the mobile space. Apple will eventually fail because not many people would purchase it, since it lacks this key feature.
Now you don't need to do this sort of thing an iOS because its only one OEM offering hardware but sideloading would allow the use of gaming emulators, Epic to offer their titles again, an official Gamepass streaming app and for other gaming sub platforms like Netflix to offer things via their own app. You could also roll back Halide to the version you paid good money for instead of the sub-ridden mess it has become now.
Emulators are not exactly legal space here. I'm sure Nintendo, Sega, Sony, Microsoft, etc. Would all prefer you not do this. It is their copyright/trademark/patents/etc. they would be protecting.
Its about protecting the user from absolute corporate control by giving them choice, not opening them up to attacks.
They are not trying to open them up to attacks. That isn't the intent. It is just an unintended consequence of their laws. And you're not giving me a choice. You're removing the choice I had to pick Apple over Android. I want a locked down gatekeeper device. I don' have that choice anymore with the way these laws are written. I'm willingly paying MORE for it. Let me! Sure, I can ignore the need to install anything from anywhere else other than Apple. However, 1 that may not last as the apps may not be available on the store post this law. 2, the ability to install without my consent just went up 100%. Since the feature is now universal on devices (at least in the EU for now, but later everywhere else). I now have to be way more mindful of what is happening on my device. And while I certainly can be that mindful. Others, not so much.
In the decade+ I've been sideloading apps on iOS and Android not once have I ever contracted any malware or security issue.
And I have never encountered any of it either, without ever side-loading.
I'm happy you know what you doing with your device and haven't had any issues doing whatever you wish with them.
Just don't take my right to pick what I want away.