Not everything makes sense from a pure private market economics perspective. Yes the state should cover heat, yes the taxpayers should pay for it. Ignoring any moral arguments that letting people suffer or even freeze to death when you can stop it there’s market economics on the government level that are important. As you accurately noted we fund a military to advance aocietal interest, whether defense or projection of power for economic or other reasons.
The government in part exists ti fund the things that are economically important but too big, too long term, or cost too much for a private company to commit to. That includes core infrastructure *and*, crucially, social services. Social service costs are a loss leader for the economy, people can work, generate economic activity, and grow the economy better if, say, they dont freeze to death.
So why should taxpayers fund heat from a purely economic POV? Because if people have basic needs met in the long run they contribute to the economy, and both create and consume goods and services that support those taxpayers in, overall, long term, higher amounts than it costs.
Also worth noting that people who are the edge of freezing to death, starving to death, etc - people who have nothing to lose - are more likely to become violent or radicalized because, hey, they have nothing to lose. Do you like riots? Terrorism? Revolutions? Keep people in abject poverty in huge amounts, create an underclass, and that is what you’ll get. Because when someone is desperate and has nothing to lose…