Because that’s what Google promised. That was the whole selling point to smartphone OEMs and consumers, and then Google went about bribing people to not release their own third party app stores.
In theory, there is nothing stopping Epic from making their own android handset with the epic games store and Fortnite preloaded on it. It just probably wouldn’t sell very well.
If Google wasn’t willing to do so, then they should never have made android open in the first place. Keep it closed like iOS and we would be having a completely separate discussion right now.
In contrast, Apple made no such promise, and so Spotify cannot sue them for blocking app stores or sideloading, because there is literally no law that states Apple has to explicitly allow them. That’s why the EU had to create a new piece of legislation specifically to address this concern.