When Android started, I’m not even sure they wanted a centralized store to begin with. Android was going to replace flip phones and their super proprietary and hard to develop for operating systems. Being open-source was part of the appeal for manufacturers (they get to customize it but still be able to run most apps just fine). Being able to sideload apps was important then because the alternative was sending a premium SMS to some number and getting the app on your phone in return. It was a market where the carriers were controlling everything. Also, Android was originally designed to be a camera operating system and later on expanded to target about any portable devices, mainly phones but there were WiFi-only Android devices too.
Open platforms are very appealing to developers. One of the reason I’ll never own an iPhone is, I can’t even try out iOS development without buying a Mac and then buying an annual $200 license to Apple just to have the right to develop for the platform. Young teenage me was like, fuck that, I can just download Eclipse and develop for Android for completely free and even share my app for free!
Android was also very popular with the developers because you could easily build and flash your own builds of Android too, being open-source.
Now it’s too late to backtrack on that without major outrage and scrutiny by legislators. Same reason it’s way too late for Microsoft to attempt to stop sideloading and force everyone to the Microsoft Store.
In today’s world, I think it’s still valuable for Google to let people do all that. The Nexus line and now the Pixel line are the standard when it comes to unlocking your bootloader and flashing a custom ROM. Google encourages developers to do that because they get free beta testing for beta builds, but it also enables security researchers to study the operating system and discover flaws that Google can then fix. They’ve also taken several popular features from custom ROMs and implemented them directly in Android, so people basically design and test new features that Google can just take for free. Things we take for granted like quick settings in the notification tray, that originated in custom ROMs. They also poached a few developers, for example the guy that made Magisk now works at Google in the security department. And as others have pointed out, it shields Google from some legal challenges as they can just say “well if they don’t like the Play Store they can just sideload another one”.
Ultimately too few people even bother sideloading apps for them to really care or affect the Play Store revenue. 99.99% of people won’t ever download anything outside of the Play Store.