Can someone explain it to me? Why do we spend so much?
To some extent it's an illusion caused by the official exchange rates' inaccuracy at reflecting how much stuff is actually being purchased. (Just think of those charities telling you that you can get a month's supply of food for someone in some other country for under a dollar.) To the extent that it's real, it's caused by one accident of history and a couple of broad factors at work in the present.
1:
The historical one is that the Cold War forced us to invest in the ability to hold off a very large and openly aggressive enemy (whose exact abilities were largely unknown at the time and thus had to be assumed to be the worst). Once that situation had passed, a level had been established as normal that the country didn't want to become weaker than. (Nobody wants to give up what they've already got even if it's something they wouldn't now bother to obtain if they didn't already have it.)
2:
Also, the USA's military forces are in a way the world's military forces, doing things that various other countries agree should be done and want someone to do; serving the general interests of stability, protecting other countries and international trade against local aggressors, occasionally intervening in one place or another. Not only do other countries benefit from American direct military activity, but their own military forces also obtain the equipment for their own independent activities from the USA, and although those purchases offset some of the USA's expenses in a way that our budget doesn't show, it still puts the costs of research and development here. So the American military budget ends up in some ways including multiple countries' worth of costs instead of only our own, while those other countries' military budgets end up including
less than their share of the costs.
This trend began in or around WWII and might have been increased by the Cold War, but has continued since then because of economic factors which tend to consolidate production into a few countries even for products that are bought by people in a larger number of other countries, particularly in high-tech industries. (Just look at civilian aircraft, electronics, and automobiles.) Concentration of research, development, and production are more efficient overall than dispersed, the few producers in such industries benefit from being on the leading edge, and everybody else benefits by not having to put in that work & expense & risk themselves but still being able to obtain its results. So the research, development, and production for much of the world accumulates to the same place or few places.
3:
The last factor is modern Occidental culture's lack of tolerance for losses/sacrifices and demand for not just victory but victory by the widest of margins even while holding back as much as possible. Nobody wants a WWI/WWII-style victory, in which both sides get pounded down but the one who gets pounded down slightly less wins. We want the other side to be overwhelmed rapidly and unable to counter or hurt us at all but still damaged as little as possible in the process of losing. That requires not just a larger or more advanced force than anyone else's, but one that's MUCH larger and MUCH more advanced than anyone else's. The less of a margin we win by and the more destruction our win causes to either side, the more it gets treated as a loss anyway and the more complaints there are that it wasn't effortless enough or clean enough. The ability to not just get the job done but get it done casually costs money, so any country which sets that goal for itself has to be prepared to not just invest more than others, but invest a lot more, possibly multiple times more.