You're exactly right. The alternative to a market is usually corruption.
My local university offers housing for grad students. At least 50% is unoccupied at any time because there is no pressure for them to fill units. That would just be more work. So getting one is tricks and favors.