The direct answer, though, is largely one of execution. Microsoft isn't just pushing this heavily. They are doing so poorly.
I will say that I think the forced linking has encouraged other unpleasant behavior like the profile folder hijacking to OneDrive. I rather like having this stuff in OneDrive. I do not like that it is pushed so aggressively. “We moved all your stuff to OneDrive. You need to subscribe so we don’t delete it.” This feels hostile. So some of the distaste with logins tied to the cloud is probably more about the surrounding ecosystem.
Why even post this?
I'd definitely much prefer if even for "ecosystem" the companies would not require online account except where truly necessary (purchases?), but for operating the OS itself, I do feel there's a line in the sand where online account requirement = no.
Try to run any developer tool or "xcode-select install" and it'll download the command-line tools independently from Xcode.
(and then bring your own IDE)
You can install XCode CLI dev tools without an Apple account, which comes with clang and swift for example. With this, you can build most Mac software, but I don’t think you can run Swift tests without a full XCode.
As the sibling comment notes, you can install GCC/llvm and whatever other open source tools and build Mac software without full XCode.
You can also install Apple container support without an Apple account.
Microsoft is a cloud provider now -- their software exists to support their cloud business.
Most people DO use one, though, because that's how you access the iCloud services that underpin the Apple ecosystem. But it's not MANDATORY.
My understanding is that you cannot even log into a Windows machine without an MSFT account. That's a big difference.
An Apple account together with an iPhone and MacBook let’s you share clipboard, passwords, notes etc., a no brainer.
Windows laptop and iPhone? I guess an Apple account still is more useful here too, actually. So the average user does not really need an MS account, hence the annoyance.
You can also still log in with a completely local account as well. It takes a few extra minutes to set up but once configured it works fine.
The system is full of dark patterns and roadblocks that steer users towards an MS account, but you don't have to use one.
The answer is: Because the Apple Login is not calling out for every service, including login.