Nadella's microsoft is not the same as Ballmer's and Gates's microsoft. In Gates' day windows licenses brought in the money, and linux and the web were the dominant threats to microsoft's revenue, completely explaining microsoft's behavior around 2000 that earned them their reputation.
Nadella's microsoft however is a cloud services company, with office 365 and azure bringing in an ever larger slice of the pie, and windows reduced to a single digit percentage of the revenue stream. Cloud services are built on open source. It makes complete financial sense for microsoft to be a strong open source backer now.