Federal and lower around the world normally are directly involved in building and operating housing.
Governments build and operate services & infrastructure when:
1. The sector is not attractive to investors due to low profit margins. E.g. roads, water treatment, or regulatory enforcement.
2. An essential sector is unavailable to a portion of the population. E.g. health care, insurance, and education.