I remember a lovely trip to NYC where we visited the Tenement Museum, I highly recommend it. Large families would live in these cruddy little spaces which were the size of some studio apartments. We learned laws to make these places more sanitary slowly and later quickly incentivized landlords to close up the tenement apartments and just rent to commercial enterprises. There are costs to renting residential housing borne by the landlord, in the case of Lower East Side landlords, it wasn't worth it.
So what are the costs to rent out say a small apartment building in DC. Well for one, you need to get a small apartment building. The cheapest building so far is an empty 4 unit near Ft. Totten for $895K. From what I can tell it needs work and could turn into 6 units if you have a lot of 1 bedroom apartments. The minimum monthly payment and we haven't fixed the place for human habitation is around $6000. If the owner decides to fix it up, that costs money to pay for permits, labor and materials. Over $1500 a unit if we have 4 apartments, $1000 with 6. Insurance, maintenance, utilities for common areas, property taxes, and property management haven't been added. There are some other concepts such as vacancy, that time when no one is in the unit covering the mortgage. Then there is the idea of profit because what is the point, unless you're a non-profit with another motivation.
Even companies and persons who've owned their properties a while still have to pay for updates, maintenance, management (the people you call when you need maintenance), insurance, property taxes and a bunch of other stuff.
But when you are the one looking to rent, that doesn't matter. There are many people looking to rent and if a landlord can charge $X,xxx for their dinky little 1 bedroom they will, provided it is worth renting it out over mothballing it.