It is absolutely a primary cause. Adding more demand worsens supply side issues.
Likewise, if people increase their savings or pay down other debts, demand isn't increased right away.
It's just not as simple to draw a line to specific government spending and say "that caused inflation".