When most people bought their PCs, Windows was already bought and paid for and installed by the vendor, so piracy might not have hit as hard as you think.
If you’re Microsoft, that last thing you want is people having a choice of operating system - either in the store, or when they get home - so you make sure it’s a done deal before the PC is unboxed.
That’s SOP for Microsoft, and what got them into trouble when they were bundling Internet Explorer.
It’s also worth noting, that Linux hasn’t always been a competitive desktop product for the home market.