Marco Gonzalez spent more than a decade suing real-estate developers in California over housing proposals that would have spoiled wetlands and gutted hillsides. The environmental lawyer won cases that stopped scores of units from being built.

Now he is on the opposite side, fighting cities and neighborhood groups in Southern California that fail to provide enough new housing units.

Mr....