The war spending did not end after the Iraqi government was overthrown in 2003. The US went into police action phase after the fighting stopped and the spending continued. We also established many bases in the region to support those wars and project our power. That's expensive. So Afghanistan and Iraq in the 2000s and, to a lesser degree, Syria, Libya, Yemen, in the 2010s. More spending. We only pulled out of Afghanistan last September.
The recent oil price surge is a combination of factors both domestic and foreign. Increases in fossil fuel costs in Europe due to government policies, US economy starting to recover from initial Covid impact, but mainly the reduction of supply of oil or the perception of the Oil Futures markets that demand will outstrip supply.
On day one, the new Administration began a policy of shutting down pipelines, Keystone being the first, reinstated methane emissions rules, fired the drill happy staff at the EPA, pulled drilling leases in various parts of the country, and started an aggressive green agenda. Not expressing an opinion on these policies, but just stating the fact that the effects of the policies reduces supply and hence prices increase.