Build taller. Build deeper.
Sure, but there's a limit to how much you can do that.
The problem is that adding more people to an existing area, in most cases, is a negative externality to the other people in the area. That ultimately restricts the amount of extra units you can add to an area. Whether that restrictions comes in the form of a government restriction, such as building codes or planning permission, or in the form of a private restriction, such as covenants or easements on the deeds, the reason is the same. Because adding more units to your building makes someone else's building less valuable, or incurs an additional expense in terms of infrastructure development.
The point is that supply of units in a given area is tightly restricted. So the basic laws of supply and demand don't get much of a look in, because supply can't expand. Changing the quality of the building doesn't do much to change that.
The only way you could change that is to change the nature of the area to a much higher density, but that requires additional infrastructure and cooperation from other owners in the area.
It should be noted that the idea of a area with few building codes, specifically for the poor, was very popular in the recent past, and it turned out quite badly. They were called slums. (UK version was tenement housing, which were quite well constructed and sturdy, but still vastly unpleasant).