The government is a producer of goods/services that are then usually not subject to market transactions.
Some goods/services that the government produce can be said to increase directly the utility of the households/individuals in the economy.
Others can be said to function as intermediate goods, entering, usually as a positive externality, the production function(s) of the private sector.
Yet others, the literature contents, can be treated as both being utility-enhnacing and private production enhancing.
An example: national roads (without full-pricing tolls). They are used by individuals to go to recreational trips (utility-enhancing) but also by businesses to transport their goods (production function externality).
Another example: a police force. It can be said that it provides a sense of security to individuals (utility enhancing) but also, it reduces uncertainty for businesses and so increases the productivity of production inputs (in the sense that one does not have to divert scarce private resources to attain the desired degree of security , when a police force operates). Likewise for military (where instead of local outlaw, the danger comes from foreign aggressors).
Etc. In fact, for most goods/services provided by the government, I would say that the dual nature prevails.
In the Political Economy sub-field, in some models the concept of government self-consumption arises, in order to capture the phenomenon of corruption which leads to part of taxes being consumed by corrupted government officials and not used to produce the aforementioned goods and services.