The questions implied by your last question seem to be:
a) do markets always provide better allocation?
b) are there cases where economic efficiency is not the primary determinant of how resources are allocated?
So, 75% of the U.S. budget is made up of mandatory payments (debt interest), medicare (for the elderly), medicaid (for the poor), social security (for the elderly), and defence.
1. Health care services are notoriously subject to market failure due to a variety of problems: moral hazard, unpredictable and highly skewed demand (a small number of people take up the bulk of national costs), adverse selection, insurance free riding, plus geometrically rising costs due to increased innovation, a culture of litiguousness, and the demographics of an aging populace.
Besides all of this, all developed nations share a sense that humans deserve a minimum standard of care, that collectively we are rich enough, and the demand small enough, that we can cover everybody (subject to the caveats above).
EVEN if you decided there is no fundamental human right to health care, then the most efficient allocation (a) is subject to predominantly non-market controls & regulations due to moral hazard & free riding; (b) someone other than the customer makes the buying decisions due to adverse selection.
2.
Defence is often subjected to market forces in the specifics of contracts, but the overall spending levels and results of defence clearly can't be measured by a market, since the mission and goal is about survival, not wealth.
Could the U.S. cut it? Sure. Which elected official would take the risk they'll be blamed for the next [insert tragic event here], though?
3. Social security, again, has to do with a shared sense that the elderly deserve a safety net when they are too infirm to continue working. It's a flawed, imperfect approach, but seems better than just letting people live off the streets in their twilight years, as was done for over a hundred years prior to Otto von Bismark's creation of the welfare state.
I have no doubt the market makes (some) activities more efficient. The challenge is that reality is more complicated than that.