Hetzner keeps running the old machines as long as they can find customers for them, which means they have entire buildings of 10+ year old machines still running.
Yes? How else do you think it works? At scale, hardware breaks all the time and must therefore be replaced all the time.
This is true even at Hetzner's scale.
How long do you want to run something that uses 3x the electricity for the same level of performance when you're buying power by the megawatt? How about the even older ones that use 10x as much?
But at some point hardware does break and if you're going to keep the datacenter open for business you'll need to address turnover of inventory on an ongoing basis, and if you haven't locked in long-term deals for hardware then you'll have to bear current market prices when you do that.
Exceptions naturally if you for some reason had an abnormally high failure rate, e.g. capacitor plague.