Governments, cities, and municipalities should stick to providing the necessities -- which today includes internet connectivity, IMO -- that are natural monopolies, and leave the rest to competition.
The rules for competition should be transparent and require quality checks, though. There are lots of people who are willing to e.g. mix melamine to milk just to get a little bit more profit, or use a bit cheaper but fundamentally unsuitable concrete mix, to ensure they won't overrun the budget, even when building something as structurally critical as a nuclear reactor. (After all, everyone assumes they can use all of the safety margin themselves, or otherwise they'll be long gone before the problem is noticed, and is therefore Somebody Else's Problem.)
I think the ancient Romans got it right: when they commissioned a bridge, I believe they paid 50% when the bridge was erected, and the other 50% fifty years later, if the bridge was still standing. Obviously, we cannot do the same today, partially because of inflation, but mostly because everyone wants their profits now and not later. Interestingly, many western societies seem quite keen to otherwise reproduce the situation of the fall of the Western Roman Empire.