We came to this state by basically unilaterally assuming responsibility for the defense of Europe. It was complicated, and had to do with the question of German rearmament after WWII (and, in no small measure, Vietnam before the US was really involved). But the short answer for why the US spends so much on defense is that we have chosen to carry all our allies. Could Taiwan support ten carriers at sea? No... but will they need ten carriers to wage an effective campaign if the day ever comes? Yes. And we have chosen to commit to providing them. It's not like we don't get anything from Taiwan in return. Or ROK... or back in the day, FRG and the rest of Western Europe.
Part of all that is maintaining a capable nuclear arsenal, and we use computer simulations rather than live tests to assure the efficacy of our stockpile. I think that's a perfectly good reason to buy lots of computers and employ lots of scientists. I guess you've got some specific, well-funded, noble alternative to retask all these resources on?