The "work" in proof of work How does proof of work function?

Why does the "work" in proof of need to have zero utility for the economics of the cryptocurrency to be viable.
If the mathematical problems done by miners had value by themselves beyond blockchain purposes, a miner could work on two parallel blocks at the same time to try to pull a double spend, without losing much money with electricity, bandwidth and other mining costs.