With Bitcoin, such excess energy can be devoted to mining. The bitcoin generated by that mining can then be sold and serve as a subsidy to the green energy producer. This subsidy changes the numbers around green energy and makes it even more profitable, encouraging more such green energy projects to be started.
It's easy to point at proof of work and claim it's a waste. I encourage you to dig deeper, however. Proof of work enables us to radically change the financial system we have today and to potentially make it more efficient.