“In much of the country, housing and mortgage affordability looks quite good,” says Aaron Terrazas, a senior economist at Zillow who was involved in the research. Not so in the Golden State: Six of 10 least-affordable regions are in California. San Jose ranks as the least affordable, directly followed by San Francisco, Los Angeles, and San Diego. Seattle comes in at number five, followed by Sacramento at six and Riverside at seven. Of the 10 most-affordable major cities, all are located in the industrial Midwest, which have weaker employment markets, Terrazas explains.

But in the Golden State, “housing supply has not kept pace for much of the past decade,” Terrazas says. In part, that has to do with a housing market in which new construction cratered during the Great Recession and still lags behind its peaks in the mid-1980s and early 2000s. The pace of new supply has been too slow to catch up with the state’s booming tech-led economy. And a thicket of state and local policies restricting development, mandating surprisingly low densities in major cities like San Francisco and preventing sprawl into greenfields. Those decisions may be defensible — few want to see a Bay Area that stretches endlessly to Stockton — but they have pushed the cost of housing beyond the reach of middle-income households.

To create the rankings, economists at Zillow calculated the down payment needed by a median-income household in each metropolitan area to purchase a median house (thus keeping with the common rule of thumb that a household should spend no more than 30 percent of its monthly income on housing). Because saving for a down payment is the biggest hurdle to homeownership, keeping to that limit places homeownership out of the hands of many in the least-affordable cities. For example, to make a down payment on the median house in San Jose, a median-income household would have to make a 49 percent down payment, totaling $614,000 — a daunting amount to save.

What makes prices in California cities so high? It can’t just be the Pacific Ocean. It might have something to do with local politics — few places are filled with more Democrats than San Francisco and New York, a fact that conservatives in places like Texas trumpet alongside their lower costs of housing. On the other hand, Riverside is reliably conservative yet high on the list, whereas liberal Austin is sometimes called the “blueberry in the tomato soup of Texas,” yet that city is much more affordable than its ideological cousins in the blue states.

Pulling in other sources of data suggests the beginning of answer: It’s the land use regulations.

The University of Pennsylvania’s Wharton Residential Land Use Regulation Index shows which cities heavily regulate their use of land and which are more lax. Published in 2007, the index represents a quantitative measurement of land use regulations in U.S. cities. The more heavily regulated land use is in a metropolitan area, the higher the price of land. For example, density restrictions that make for fewer units on the same plot of land or mandatory studies about a building’s effects on wind and shadows lead to higher costs, which you’d expect to be passed on to consumers.

(Two quick technical notes: The index’s values run from 1.79 for the most regulated city to –0.80 for the least regulated. We’re omitting results for cases in which there’s no Wharton Index value.)

If we plot the Wharton Index against the affordability measure, here is the result: