Governments can and do target GDP with their spending, with predictable results. The classic example is "ghost cities" in China. They have ghost cities nobody lives in, ghost roads nobody drives on, and ghost bullet trains that go nowhere useful. All because regional governors are expected, one way or the other, to match GDP targets for their regions.
Goodhart's law applies here. "Any observed statistical regularity will tend to collapse once pressure is placed upon it for control purposes." or "When a measure becomes a target, it ceases to be a good measure."
GDP is subject to manipulation when it becomes a target. So is lots of other things like "Consumer Price Index", which nowadays doesn't index a whole lot other then what the goverment's target is for inflation (and yes, the Federal Reserve actually counts as part of the "government" here).
Which means that GDP, like the CPI, is not particularly useful measurement anymore.