Legislative efforts in two of the country’s most populous states to boost urban housing construction are facing a common barrier: resistance from construction unions.

In California last week, legislators and interest groups declared dead a measure pushed by Gov. Jerry Brown to allow certain apartments with some low-income units to sidestep the state’s environmental review process. That followed a failed effort by state lawmakers in New York earlier this year to renew a widely used tax break for rental housing in New York City; now lawmakers there are straining to reach an accord to revive it.

For both measures, construction unions were key to the defeat, as they won over key allies with their argument that the government shouldn’t be aiding apartment development without also guaranteeing union-level wages. Unions, particularly in New York, have been facing a gradual erosion of their market share on residential developments, and now developers that a generation ago would have been union shops are able to fill jobs with nonunion workers, which can lower construction costs by an estimated 20%, according to New York-based Citizens Housing and Planning Council, a low-income housing group.

Robbie Hunter, president of the State Building and Construction Trades Council of California, said policies like the one pushed by Mr. Brown should allow construction workers to make a decent living “rather than drive those workers into the need of affordable housing itself.”

The housing measures in both states are strongly supported by business groups, developers and many low-income housing advocates. Particularly in San Francisco, economists and others worry the rapidly growing housing costs are going to hurt the region long-term, straining the ability of businesses to keep growing.

“We’re in this huge hole and it’s rippling through the economy,” said Matt Regan, senior vice president of public policy at the Bay Area Council, an advocacy group backed by large employers. “Bold action is required.”

The future for the California measure is unclear, as it also faced resistance from local governments that bridled at ceding control over land-use decisions.

The New York tax break, by contrast, has far broader support, including from New York City Mayor Bill de Blasio, many housing groups and the real estate industry.

But Gov. Andrew Cuomo, who once served as the country’s top housing official, strongly aligned himself with the construction unions, letting the legislation lapse in January, having been unable to reach a deal that satisfied the labor groups. Discussions on a compromise have picked up in recent weeks, including one that would include a state subsidy for some union-level construction wages, according to people familiar with the discussions.

The issue of housing and construction union wages has long been a tricky one for Democrats, who have generally sided with the creation of more housing, particularly when low-income units are included, as they would come with the tax break.

But Mr. Cuomo has gone the other direction, siding with the construction unions, with whom he has long had a close bond. They were strong backers of Mr. Cuomo’s 2010 gubernatorial run, breaking the mold from many in labor, who were frustrated with Mr. Cuomo’s call for cutbacks from public-sector unions.

In a speech to the AFL-CIO earlier this month, Mr. Cuomo addressed the housing legislation, saying, “government shouldn’t pay a poverty wage, that’s why I want to pay more” for union labor.

Gary LaBarbera, president of the Building and Construction Trades Council of Greater New York, said “There’s still a long way to go” on legislation, but he is hopeful a deal can be reached.

It's counter productive to raise construction costs on the front side, then punish developers by mandating "low income housing" or "rent control" on the back end. It just means that the average person will pay more for less