Never really looked at it that way. I never put the space program in the same pocket with supporting the troops. There may be some military people involved with the space program. Your right the welfare and wealth redistribution is worse waste of funds than the space program.
There are many military folks involved, you just don't see much about them, and I wont elaborate.
For better or worse, the shuttle design was DoD driven, and you probably recall several flights many years back when they carried classified payloads. The Challenger failure changed a lot of that, so today the remaining shuttles are really over built for the Non DoD missions.
NASA is like any other agency. It has its meat and its fat. But by and large, it still does a lot to drive research in many important areas that flow down to the troops as well as to the general economy. Cant say the same for midnight basketball.