> why would google ever sell the software in the first place?
To earn money. But of course (without restrictions) there would be more competition, there would be alternative Android builds and, as a result, more software not depending on Google Play Services.
If Google could choose Apple model and be profitable, they would choose it from the start. But there is a big difference. Apple makes their own hardware and is good at it. Google doesn't and maybe they didn't want to take a risk so instead they have chosen to make only the software. Also we should remember that Google came to the smartphone market late when it was already conquered by Apple.
For example, Google has tried to enter laptop market with Chromebooks but without noticeable success.
Even if Google makes Android closed source, it doesn't mean that there would be no open platform. Maybe someone will continue developing Android, or some other OS, maybe someone will make a Linux distribution for smartphones.