It's an incredibly smart move on their behalf.
Let's face it, Microsoft has been just as "proprietary" as Apple over the years. However, it has much more at stake in terms of it's software adoption, which would be comparable to Apple's focus on hardware adoption. They both play a little bit with both, but it's clear (at least, imo) as to what their primary focus is.
The thing missing from Apple? PCs and laptops you can pull apart, upgrade and stick with past the life of the initial purchase.
The thing missing from Microsoft? Unix, baby. Even though macOS is a flavored version of Darwin, it's as close to a true Linux/Windows "hybrid" that we've ever had. The Windows Subsystem for Linux (WSL) , I feel, was our first clue of how much they wanted to bring the Bash Shell into the mix.
Now, with the purchase of Github - followed by many teams abandoning it at that point, screaming "Sell Outs!" - they honestly needed to prove their worth in the world of open source development, and this seems to be a great start.