It is one of the fiscal policy in macroeconomic that the government spending is good for the economy during recession. The theory of government spending during recession is to reduce unemployment rate, so that people have more money to spend. When there is increase in demand it will increase the production also.
This is not as simple as it sounds, the government spending can also be bad for the economy. There economic formula that will suggest the path of government spending. This is called multiplier formula. The government sometimes spends on the things that does not generate returns and the multiplier model can show how much the returns will be when the government spends. If the multiplier is greater than one then it is good for the government to spend on the certain path, and if the multiplier is smaller than one or even equal to one then there is no point of spending on that certain path.
There a lot more issues in government spending, and it can also be illustrated with economic models when government spending is high the consumption also reduces and people will have less time for the social life. When there is high government spending then there is an increase in aggregate demand, people will have to work more hours to satisfy the demand.
It is important for government to find the optimal level of government spending. When there is low government spending there is an increase in consumption and also increase in time for social life. People will have to work less when the government spending is low. There problem is that when government spending is less the income reduces therefore people will naturally have less money to spend. Therefore, government should find the optimal level of government spending and they should also use multiplier models to know the path of spending, if it will stimulate the economy.