Because the chain of transactions with the most accumulated waste is chosen as the "correct" chain. In order to double-spend, you have to cause a different chain to be the "correct" chain, so you'll have to waste even more energy than has been wasted by everybody else, over whatever span of time you're trying to roll back. Thus the more waste, the more secure the chain.
Proof of stake is a newer way of coming to consensus on one correct chain. It took people a while to figure out how to do it securely and efficiently.