I don't think that it has anything to do with altruism. Back then, it was not the right time to optimise for profit as new and exciting things were happening daily, it was time to explore not to exploit.
These days the exciting things are happening in other areas, so for the Internet giants, it's time to optimize for profit.
Also, as a smaller player, they stood more to benefit from open source projects (Android and Chrome) and open standards (the web and email). Now that they're on top, the most rational strategy is to secure their position by destroying the bridges they used to get there, locking down those open technologies.
These days the exciting things are happening in other areas, so for the Internet giants, it's time to optimize for profit.