They don't have losses because it costs them 1 dollar to operate a VM that they sell for 70 cents.
They have losses because they are paying for construction of datacenters that are to be utilized in the future.
If, instead of $$$, they had treated customers like human beings rather than statistics, that might have paid off. As is, I'd say the effect was literally the same as if Google had poured millions of dollars into the California wildfires by quite literally dumping paper dollar bills into the fire. Google lost a bunch of money, and their problem went from few customers to vocal, dissatisfied ex-customers.
Mature the ISV and SI ecosystem so partners build the business for them.
Acquire profitable companies to fill critical gaps.
Create differentiated industry solutions and products and sell them based on business outcomes (value based pricing, consulting model).
Just a few ideas.
Google maps is a great example.