More precisely, "Everyone does".
Microsoft's code isn't especially shoddy [...]
Actually, producing shoddy code is precisely what Microsoft is know for. All they are interested in is locking people into their ecosystem, and producing good code is a disadvantage in that business model. The worse their code is, the more difficult it is for users to step away. User lock-in has always been their goal, and they don't even lie about it. This moat strategy is arguably the most deliberate and consistent part of the company's history.
For instance, they created the SMB file protocol not from computer science first principles, but as a hack. And so everyone who wants to interoperate with it (e.g. Samba) is then locked in a decade long attempt to reproduce every single bug in their own code.