What do you mean by "bad" housing?
One possible reason is that many of the relevant aspects of good or bad housing are governed by building codes (plumbing, HVAC, bathrooms, room size, etc.) which put a (often high) lower bound on how cheap a building can be built. In addition, the organization of the construction industry (many specialized subcontractors) means there's a fairly high fixed cost for any new construction. While this mostly applies to new construction, it can apply to existing buildings as well.
This is part of a two-week experiment on having more open threads.
Obvious answers aren't always obvious. If you feel silly for not understanding something, you're not alone. Ask a question here.
Previous stupid questions
Other similar threads include: