In addition to supporters like the Natural Resources Defense Council, the payments start-up Stripe and unions including the United Farm Workers, the bill gained the backing of several counties and dozens of elected officials, including Mayors London Breed of San Francisco and Adrian Fine of Palo Alto — both representing cities where development is notoriously expensive and difficult.

But their opponents were also a diverse coalition. Take, for instance, Livable California, a group that was formed largely to oppose Mr. Wiener’s bill and others like it. The organization was founded by homeowners in exclusive suburbs in places like Marin County and the San Francisco Peninsula, but also counts activists from Leimert Park, a middle-class and predominantly African-American neighborhood in South Los Angeles, among its members.

“Nothing in this bill is giving us more say; it’s taking away what little say we have now,” said Isaiah Madison, a 24-year-old graduate student in Leimert Park who recently joined Livable California’s board. “I’m not against development. I am just for communities navigating that development with a developer. We have community plans in South Los Angeles that we’ve been working on for 30 years that included a lot of input from a community that has historically been underrepresented in urban planning, and I think that’s important to protect.”

The road to S.B. 50 began in the previous legislative session, when Mr. Wiener introduced a similar measure that prompted a national conversation about exclusionary land use rules that lead to segregation by income and race. It also tested the degree to which even liberal California voters were ready to embrace higher-density neighborhoods near job centers, an approach that various policymakers and researchers say is crucial to curbing emissions that cause climate change.

That bill was killed in its first committee vote in 2018. Mr. Wiener’s office has spent the intervening years modifying it to attract support. Among other things, provisions were added to protect tenants from displacement and to delay implementation for two years to win over cities that said the bill hampered passage of their own housing plans.

Though the governor’s office says it still wants a big housing bill like S.B. 50, Mr. Newsom has also declared that zoning reform is useless if cities don’t build in line with state housing plans. To that end, he has pushed an initiative to build affordable housing on public land, pressured cities to accommodate more housing and actually issue permits for what it zones, and signed legislation penalizing cities that don’t meet their state housing goals.