That magic wand is called public policy. There are similar things you could say about food -- i.e. how unregulated markets lead to developing countries being forced to export cash crops instead of growing food that people in that country need to actually eat.
>That is a huge claim. If people could use their land as they like there probably wouldn't be a housing shortage. Developers make large fortunes out of install dense blocks of apartments; and doing that isn't going to make housing more expensive.
4.8 million households in the U.S. depend on Section 8 to afford rent. These are direct subsidies to landlords to house these people. In an unregulated market, landlords would not rent to these people, and they would be homeless, or they would live in actual slums, which don't really exist in the U.S., but would have to in a fully unregulated market.