They have before. Android? Not microsoft, but same concept, and linux kernel to the core.
What does Android has to do with Linux besides using the kernel? You can literally take any code from Linux and use it for anything, even hacking governments. What do the ethics of Android or Google have to do with Linux?
No, the world's biggest open source repository has nothing to do with a project like Android, they could never use code that way at microsoft, etc...
Github is literally all about sharing code, it's just a platform that hosts code. You can't prevent people from using the code anyway they want. Do you think Microsoft will kill that idea after they just invested $7.5 billion into it? Even if they did, what is preventing Linux to go to exact clones of Github like Bitbucket or GitLab? Microsoft bought Github to invest into open source and push their developer tools, not block open source. They know they cannot fight it in the long run. Might as well own it and make Windows open while they're at it. All they are doing is fighting for minds at this point and changing their business model to probably mimic Google's Android to get some of that same success. Doesn't mean they won't collect your data (they definitely still will), but that at least makes them safe from the open source competition taking their market share away anymore. That's all they care about at this point. And to sell Surface tablets, of course... This is all just a big stunt to sell more hardware in the end. (Don't forget Microsoft already tried the Apple closed model with Windows Phone and we all know how that turned out.)