The US military budget is an expenditure that occurs every year. Apple's market cap is the expected value of all of Apple's outstanding shares. These are really not comparable.
If anything, the comparison drives home how big the US's military is.
>> That is even higher than US military budget. I really don't know which one is a bigger waste of money and effort
A budget and market cap are fundamentally two different things, and are incomparable.
Just to be clear, those numbers aren't directly comparable. The market cap is the total value of the company, whereas the yearly budget is the cost for a single year.