Like iOS device, it's also creating an ecosystem of devices/service. How many people now have gmail accounts, and are searching through google then before they had Android devices?
Google hopefully understands (don't see any indication they don't) that they are getting a channel to market directly to users as well as obtain new users. This system gives them a platform to directly compete in a variety of media markets, now as a content provider in addition to their ad model.
Google wants to create a platform that will dominate all mobile devices for years to come. Cell phones (and, more recently, tablets) are just one aspect of that. They want a standard OS for any small-scale device. In their vision of the future, your coffee maker, refrigerator, and laundry machine may all use an Android-based platform.
This is one of the reasons why they are perfectly happy with Android being used for cheap smartphones which are really just amped-up feature phones. They don't want to be seen as elitist, the way that Apple tries to market itself as high-end. They want to have high-end products, sure, but it's equally important to them that they cover the range of that spectrum.
I don't know if they had exactly this in mind when acquiring Android, but by now, it seems clear to me that this is their goal.
Judging by Android users I see around me, not a single one.
Apple has that pesky hardware business eating at the margins. They are a very, very efficient manufacturer, but hardware margins are always less than software (especially search, which might be the most profitable business ever in terms of margin).
(Also, don't forget Google makes a huge amount off mobile search on iOS devices).
Google's profit margin is 26.7%[1] which includes all the money the spend on non-revenue generating engineering like Chrome, ChromeOS, etc etc.
Apple's profit margin is 23.95%[2], and they have very few non-revenue generating activities.