This sentiment is completely untrue. Defense is approximately 12% of US government spending, healthcare approximately 24%, education approximately 15%, and social security roughly 20%. Infrastructure is harder to categorize, but the truth is that the US government spends at least 4x more on healthcare, education and welfare (combined) than defense.
https://www.usgovernmentspending.com/year_spending_2023USrn_...
The fact that this 12% of government spending amounts to the largest military on earth is in large part a consequence of the fact that the US is really, enormously wealthy compared to most of the rest of the world, has a fairly large population, and still has a larger GDP per capita than any other large or even medium-sized country.