Increase in M1 money supply isn't just spending but includes it. The Feds decisions for the last 5 years have cause this inflation. Not raising interest rates properly/timely, quantitative easing, printing money and yes government spending money(helicopter money) all caused this mess we are in. If the fed had done their job correctly and If the economy was manage correctly when coming out of Covid we would be in a much better situation to manage higher energy prices. 2011 threw 2014 gas prices were close to $4 per gallon but inflation averaged 2%. So higher energy prices have some, but if the economy is managed correctly by the central bank, minimal effect on inflation. On the other hand if the central bank allows MI money supply to explode like it has, higher energy prices hugely magnify inflation. Inflation is too much money chasing too little goods. If the Fed did not juice the money supply in the last few years and massively in the last year and a half there would not be the huge inflation numbers number we are seeing.
If you still have your Econ 101 text book please check it out :-)