They lost to the search engine.
I think Microsoft have waken up and realize they need to be active in all spaces that open source is at. It seems like this moves will help their cloud business since there are so much money in there.
Supposely their Azure cloud is doing well and I guess they need to keep at it.
I agree that they're not doing it for the pure of their heart but rather it's money driven and fear of being left behind again.