The cost of developing and maintaining Proton, Linux driver improvements, and their own Arch-based OS has probably exceeded the amount they saved by not shipping Windows on Steam Deck.
But what they got in return is a much more usable gaming operating system that doesn't constantly pester you about switching to Edge, using Copilot or draining all your battery for an update while you game
What they got in return is freedom from Microsoft's arbitrary OEM hardware requirements like having a front camera for Windows Hello, or having a TPM
What they got in return ultimately is leverage. As sibling comment mentioned, they were in fear that they could be kicked off of Windows by Microsoft. Now, Microsoft is the one in fear that if they ever kick Steam off, gamers now have a perfectly functioning alternative operating system to switch to.