Where the heck are you getting your numbers? $24 trillion would be something like 1.6 times the total US GDP, how would it even be physically possible to spend that much?
Per the official US Budget DoD section, the total amount including supplemental spending hasn't exceeded $666 million. (see here: http://www.gpoaccess.gov/usbudget/fy10/pdf/budget/defense.pdf)
Wikipedia's got a pie chart showing general expenditures for 2009, demonstrating that total defense spending was 23% of the budget, whereas Medicare and Medicaid are barely less at 19% of the budget (here: http://en.wikipedia.org/wiki/File:U.S._Federal_Spending_-_FY_2007.png)
But the big problem, as noted, is not today's spending, but what happens in the future. Wikipedia's got a great graph for that, too: http://en.wikipedia.org/wiki/File:Medicare_%26_Social_Security_Deficits_Chart.png