An algorithm that "wastes" energy and provides no value is necessary and unavoidable.
Suppose the results from mining had value and miners could access that value. There would be an increase in revenue that would make mining more affordable and attract more mining capacity. The result would be an increase in the difficulty equivalent to the additional value accessed by miners.
In the end, the waste would not change and any value extracted from mining would have a cost equal to its value, and so there would be no net benefit.
Here's a simple example.
Suppose the block reward is 10 bitcoins and the cost of mining a block approaches 10 bitcoins, the value of the block reward (that's how the economics of mining works). In this case, energy worth 10 bitcoins is wasted.
Now, suppose that the results from mining a block produces some kind of scientific value that the miner could sell for 1 bitcoin. Due to economic incentives, miners would then increase their capacity until the cost of mining approaches 11 bitcoins because the extra 1 bitcoin of revenue allows them to break even at that cost. Now, energy worth 10 bitcoins is still wasted and the scientific value costs miners 1 bitcoin.
My belief is that the only way a mining algorithm that produces something of value could reduce waste would be to produce a public good. However, it is not clear that public goods actually exist.