If you just need to buy 2 servers instead of 1 then sure, yeah, developer time is more expensive than hardware.
I know of only a few that need 10...
But it's not just servers. You are up against physical availability of stuff, and stuff gets exponentially more expensive as you approach the limit. A programmer who is wasteful of memory on a single box will eventually reach a point where you simply can't buy more, you will have to rewrite the app to run on more machines, for example. At the small scale, sure, programmer time is expensive. But on an industrial scale, programmers are pretty cheap compared to say "building and operating an entire new datacentre".
And computers are cheap, regardless of how many you have. You say a datacenter with 50K servers is expensive, but imagine how bad would it be to maintain a building with 50K programmers...