Feudalism had a lot of good points structurally, replace the lord with public servants and I don't see the problem. The city builds the housing, and it becomes part of the tax revenue forever. If the city prices basic housing too high, economic activity falls, tax revenue falls, and the city declines
Shanty towns aren't good, but we haven't fixed the problem, we just have homelessness now