That's just good business. Google is a company that's run for profit and is ultimately answerable to its shareholders. Google's job isn't to perform a social good, it's to continue making money. If it has areas of its business that are net losers (with no hope of eventually performing) then it has an obligation to do something about this.
For a good example of a business that divested its underperforming businesses to the great benefit of its shareholders, look at General Dynamics beginning around 1994.
For a good example of a business that divested its underperforming businesses to the great benefit of its shareholders, look at General Dynamics beginning around 1994.