Microsoft wants people using and developing on Windows. There remains a ton of that in business environments and for traditional desktop software, but MS lost a lot of mental market share for development of browser-based apps and for server-side development, because a ton of that was being done on Macs. The frontend work could be done on anything (in part because it's all going to have to run in browsers on anything), but a lot of the toolchain for backend development went to Macs because they were running *nix (fine, BSD, whatever) under the hood and the environment was similar to where that software was going to be deployed.
Sure you *can* run Ruby, Python, whatever on a Windows box for development purposes, but for a long time (particularly in the XP days) that made you a blue monkey.
As for the financial side and closed-source products like Windows and Office, most companies aren't concerned about the cost of those - they're concerned about the *value*. Microsoft sells a bunch of subscription services in Office365. Know how much those cost? Less than 1/160th of the monthly cost of employing the people using them. It's absolutely possible to go with other options (LibreOffice, GSuite, Softmaker Office, etc.) but when you dig down to it the savings of doing so may not be that much bigger than the different costs of doing so.