Why do cities adopt and maintain laws that restrict land use, creating a shortage of affordable housing? Dominant explanations emphasize the economic incentives of homeowners to preserve their property values. The origins and racially disparate impacts of these laws suggest another motivating factor: the desire to maintain and further racial segregation by white residents. I characterize for the first time the extent of exclusionary zoning in the United States: across over 100 of the largest cities in the country, the median city allows multi-family housing to be built on only 12% of residential land. Then, leveraging exogenous factors for Black migration to Northern cities from 1940 to 1970, I show that increasing racial diversity causes cities to zone less land for multi-family housing. Analysis of public opinion surveys during this time period shows the Great Migration caused a racial backlash among urban white voters, which translated to policy action. This evidence suggests that exclusionary zoning was adopted to maintain racial segregation and that opposition to multi-family housing cannot just be explained by desire to maintain property values. I rule out alternative explanations of increased homeownership rates, different city institutions, or differences in federal intervention driving variation in zoning. These findings show how racial threat can be channeled into racialized public policy and provide a new explanation for inequality in housing markets today.