Because Microsoft isn't a software company anymore, and never was a hardware company. They're services-first now.
They make the majority of their money from businesses with lucrative support contracts, Azure, Active Directory + Office Enterprise suite, etc.
They make the majority of their money from consumers via stuffing Windows with "promotions" (ads) and from Office 365. It is services. Windows barely earns them anything.
Hell, the fact that they're thinking about opening up the Xbox to Steam and have official tutorials on running Gamepass on iOS and Linux should tell you that they don't care what OS on which device you use, so long as you are subscribed to their services.
In an environment like that, a vertical integration play makes little sense. You want your services to be on as many platforms as possible, not attract ire and roadblocks from your partners.
On top of that, they don't have a phone platform onboarding people to the whole hardware ecosystem. Even for Apple, Mac + iPad + AirPod profits are dwarfed by iPhone profits.