Janitors in New York City used to be better off than janitors in Atlanta. Not anymore.

Housing costs have skyrocketed in America’s wealthiest and most economically productive places. So much so, that even though low-skilled workers make more money in places like Boston, New York, and San Francisco, after rent or mortgage payments, they are worse off financially than their counterparts in less dynamic places. The same is not true of high-skilled, high-paid workers, like lawyers, because housing takes up a smaller portion of their household budget—52% of the average janitor’s income goes to housing in New York, versus only 21% of a lawyer’s pay.

The upshot of this is that low-skilled workers are no longer moving to America’s most prosperous cities. In fact, they are moving away.

These are the findings of a recently released paper by economists Peter Ganong of the University of Chicago and Daniel Shoag of Harvard. Restrictive land-use laws are largely responsible, they say. If not for these laws, the housing supply would have grown to meet the burgeoning demand, keeping prices manageable for the middle class, according to their analysis.

Ganong and Shoag’s begin their argument by establishing three facts:

1️⃣ Housing costs have grown much faster in high-income places than low-income ones since 1960. Housing has always been more expensive in high-income places, but the difference is getting more extreme. In 1960, on average, US states with 10% higher incomes had housing costs that were 10% higher. In 2010, states with 10% higher incomes had 20% higher housing costs.

2️⃣ Due to high housing costs, low-skilled workers have less incentive to move than they used to. In 1960, the economic benefits of moving from a low-income state to a high-income one were similar for both high- and low-skilled workers. By 2010, the benefits of moving were three times greater for high-skilled workers than low-skilled ones, in terms of incomes after housing expenses.

3️⃣ Low-skilled workers are now moving away from high-income areas. Historically, high-income areas in the US attracted workers of all types. Now, housing costs in those places have made even relatively high pay for low-skilled jobs worth much less after expenses. So instead of leaving low-income Texas for high-income California, there is now a reverse migration from California back to Texas.

Ganong and Shoag believe all three of these facts are explained by construction regulations.

In order to prove this, the researchers conducted a innovative analysis. From a legal database, they collected data on the number of court cases in a state containing the word “land use” every year, starting in 1940. The idea was that when cities implement rules that limit housing construction, developers will usually test those rules in court. The researchers thought the number of cases could be a good proxy for tighter regulations.

They were right. The number of court cases is highly correlated with other organizations’ measures of the ease of building houses, such as the American Institute of Planners and the Wharton Index of Regulation.

The researchers then analyzed the effect of stricter building regulations on housing costs. They find that in states where there were few land use cases, a 1% increase in incomes leads to a 0.8% increase in housing costs. In the states with the highest number cases, a 1% increase in incomes leads to 1.6% increase in housing costs. The main beneficiaries of the rising costs of housing are the old and wealthy, who already own homes. They are often the people fighting for such regulations.

Based on his discussions with economists who study similar issues in other countries, Shoag thinks his research extends beyond the US. For example, London’s housing prices (paywall) have risen dramatically in part because of strict restrictions on building in large swathes of the British capital.

The fact that moving to an economically thriving city is now prohibitively expensive for low-skilled workers has serious negative consequences. It exacerbates inequality, separating society into haves and have-nots. Some state governments, like California’s, are trying to stop cities from implementing unnecessarily restrictive housing regulations. More should follow suit.