Can government and people spend money foolishly be a main cause of inflation?
No, it cannot cause inflation. Inflation is a general rise in the price level, a decrease in the purchasing power of money. While military spending, for example, could cause inflation if paid for through seigniorage (essentially, devaluing a currency by printing more of it), there's neither any reason in theory nor any empirical evidence to support the idea that inflation would result from military spending per se.

Intuitively, if spending were shifted toward military expenditures and away from consumer expenditures, the price of consumer goods would likely fall, not rise. Similarly, the effect on producer prices would be ambiguous, as the price of consumer goods would likely fall, while the price of military goods would likely rise. If prices aren't rising, you don't have inflation.