Beneficial proofs of work
Your first point is indeed right: The BTC puzzle is only useful for ensuring the security of the blockchain.

Onto your next question: One of the first attempts to define a "useful" PoW was Primecoin, created back in 2013. Additional research in this area is being done.

In defense of Bitcoin's PoW, some people have said that Bitcoin mining tends to use up energy that would otherwise go to waste. For instance, if a hydroelectric plant is no longer being used for its original industrial purposes, then it can instead be harnessed for BTC mining. Mining on fossil fuels is currently unprofitable.

Of course, a more "useful" PoW could harness this energy for something even better. But even then you have to weigh up the pros and cons of switching BTC/ETH to such a PoW function. And you'll probably come up short.