This is why I strongly prefer "Universal Basic Housing" over (or in addition to) UBI. Landlords must be forced to provide a useful service for a good price instead of just freeloading off of the risk of homelessness.
Please no. How many times do cities have to try and fail at public housing for us to realize that the government cannot provide nor maintain it efficiently. There are much more effective ways that government can provide housing:
1) Allow actual competition. Adopt Japan-like zoning to make it easier to build. Landlords cannot freeload if they have competition. Make it harder for small special interest groups to veto new development.
2) Set property taxes appropriately or implement a land-value tax so that landlords have to pay for part of the surrounding improvements.
Most of the time is taken in getting approvals and permits, things that cities have direct control over and can + should optimize. Just doing that will decrease costs since a quicker turnaround means faster ROI and less risk for a developer.
You're right that cities do not expand uniformly, and city improvements are also not uniformly distributed. This is why a flat property tax does not make sense. Use land-value-tax to balance. If one area is very desirable, increase land taxes in that area and use the revenue to fund improvements like parks, libraries, schools all around the city.