cloud, not hosting. hosting is just part of cloud. Well, the first reason is that if Google misses this growth opportunity, they will be punished badly in the market, which will affect their ability to complete long-term against Amazon and MSFT. Growth in cloud is what growth in mobile was 10 years ago: critically important to remain relevant in a market. When cloud switches to "profitable mode" some time in the future, if Google isn't in a position to benefit from that, they'll have huge revenue and ultimately profit issues compared to Amazon (which has already surpassed Google on the basis of its cloud growth). So it's an existential thing.
Everybody thought social growth was critical (5 years ago, everybody thought Facebook would eat Google due to growth in mobile ads), but it turned out that social growth was not necessary, instead maximizing watch time on youtube and maximizing app installs in Play both turned out to be far more important. Google isn't worried about Facebook like they used to be- they're worried about Amazon and Apple.
But Facebook is and did take a huge bite out of the total ad market. Facebook has roughly 1/3rd as much ad revenue as Google on a far smaller investment of infrastructure and a narrower range of products.
That's true but the market grew, rather than staying constant size, and nobody considers Facebook an existential threat to Google any more (which helps Google in the market).