Unless you want to —literally— live under a Hitler, Stalin, Pol Pot, Mao, or Putin, democracies must always be better armed than autocracies. Autocracies always expand and take over less-well-defended self-determining peoples, and life under an autocracy always gets worse.
Obviously, it would be ideal if we didn't need to constantly and diligently defend ourselves from autocrats and would-be autocrats, they still exist in the world, and we must still defend against them. Yes, mistakes are always made, both in over-defending (e.g., Vietnam, Iraq) and under-defending (e.g., Balkans, Ukraine), but that does not eliminate the necessity. Wishing the world were different does not make it so, as much as you and I would like it to be so.
>> all the great things that these people could of done if they applied their talents to something meaningful.
Also, much of that work actually does get out eventually to products that are meaningful and useful to everyone. GPS, satellite communications, carbon fiber composites, and more are just a few examples of great things created initially for defense work, and that are now used universally. I work in carbon fiber and make things for everything from the DOD to sporting goods for kids.
None of it is a waste (anymore than there is waste and inefficiency inherent in any large organization). I hope that makes you feel a bit better about it.