Therefore, the sum of the rents of the tenants of the property is enough to cover the purchase of the building, which is a subset of those costs.
The "sum of the rents of the tenants" isn't relevant to a single tenant, the loan isn't used to "secure the purchase", and you're confusing cash flow for total equity.
A building owner puts down a deposit for some percentage (say, 20%) of the building's cost, gets 80% in debt, and pays down that debt over time with the cash flow from the tenants' rent payments. They make a small margin net of expenses, plus whatever equity accumulates over time.
Setting aside the (significant) question of whether or not a given tenant would have the credit necessary to do such a thing, a tenant is not necessarily able to do the same thing, just because they can afford to pay the rent.
Real scenario: Someone buys a 4-plex for $1M. They put in $240K down payment. That's $60K per apartment. Will those tenants have that $60K they can put down to continue living there?
Sure, they'll own it and can get it back if they sell, but the majority of tenants don't have that kind of cash lying around.
The other components of the market aren't fixed and immutable.
If state governments wanted to mandate denser rezoning and smaller minimum unit sizes once unaffordability reached a certain level... they could.
Pointing at expensive housing and saying "We therefore have to make it cheaper by forcing more people into bargains in which they receive none of the gains" seems like the tail wagging the dog.
Micro housing that's cheaper should certainly be able to meet that bar.