It's about priorities. Swiss defense spending as a percentage of GDP is 0.675%. US defense spending as a percentage of GDP is 3.2%. I just picked a simple example, but you will find similar disparities across the board.
FWIW, Switzerland has a higher GDP per capita at $82k as compared to $62k for the U.S. Swiss per capita defense expenditures are closer to ~1/4 (28%) of those of the U.S. as compared to ~1/5 (21%) when judging by GDP percentage. (Conversely, France and U.K. have GDPs of about $42k, so they compare much worse by that metric.)
But more importantly, Switzerland isn't a NATO member.
The defence spending isn't much compared to the social expenditures. Switzerland spends roughly 30% on social/welfare (and roughly 10% on transportation infra). US spends roughly 50% of its budget on social/welfare and it ain't getting better any time soon.
And part of US Defense spending helps defend countries like Switzerland. Maybe we still spend too much, but we also "defend" a lot more countries than ourselves, and a lot more territory than Switzerland.
Switzerland is a neutral country and not part of NATO. The US has no obligation to defend them. Almost every adult male Swiss citizen has received military training. The country may not spend as much as the US, but Swiss citizens are willing to pay for their freedom in a different way.
(..and yes, only men are conscripted. Switzerland is a great country, but there continue to be problems with sexism, even today)