LOS ANGELES—This city became the latest major U.S. municipality to require that developers include affordable housing in new projects—a move hailed by advocates, but one that builders say could crimp the supply of homes in the nation’s second-largest housing market.

Policy makers in cities around the U.S. are turning to so-called inclusionary zoning programs to ensure developers set aside housing units for residents who couldn’t otherwise afford to live there.

Nearly...