Microsoft contributes to the python foundation, Linux, and lots of other non-profits with valuable IP. I’m sure if any of those nonprofits stopped releasing source code and began giving it only to Microsoft, there would be a lawsuit as well.
OpenAI was still effectively sharing their research until last year.