The government is not separate from the economy. It is
part of the economy.
I'll give you an example: the city where I live supplies clean water to the citizens. For this service they charge a fee to everyone who is hooked up to the city water supply. If that was a private company providing the same service, would it suddenly count as part of the economy where before it didn't? The same people would be providing the same service for the same fee. It doesn't make any sense to say that the service the city provides is not part of the economy.
The same goes for every service the government provides. It employs people, takes in money, and spends money. It's part of the economy. No different from any corporation except that it has the right to do certain things that private corporations can't, and also it's run democratically whereas private corporations are not.
And yes, they spend every penny they take in, because it makes no sense for them to do otherwise unless they are trying to intentionally reduce the amount of money circulating for some reason. Private corporations could do that too, if they wanted, they just don't.