PHOENIX — A veteran state lawmaker is pushing legislation that would allow businesses to discriminate against gays, and potentially women and Jews, as long as they were acting on sincerely held religious beliefs.

SB 1062 would allow businesses sued in a civil case to claim they have a legal right to not provide service to an individual or group because it would “substantially burden’’ their freedom of religion.

Sen. Steve Yarbrough, R-Chandler, said the measure is aimed specifically at preventing what happened in New Mexico, where courts said a gay couple could sue a photographer who refused to take their wedding pictures. But Yarbrough said his legislation could also be interpreted to allow motels with vacant rooms to refuse to rent to gays.

Yarbrough acknowledged there may be individuals who have religious beliefs about serving or employing unmarried women, or employing people who do not share their same beliefs.

But he said he believes it would be hard for someone accused of such discrimination to hide behind his law because existing laws let the state prohibit discrimination if there is a “compelling governmental interest’’ in doing so. Yarbrough said he believes there are enough legal precedents against bias based on gender and religion to keep a business owner from using his or her own beliefs as an excuse to discriminate.

But Dan Pochoda, an attorney with the American Civil Liberties Union, said he’s not so sure, which is why his group generally opposes laws that protect against what he called “indirect burdens’’ on an individual’s religion.

“They generally result from persons claiming that their religious beliefs entitle them to disregard civil-rights laws that protect against various discriminations including on the basis of religion, gender, marital status, national origin and sexual orientation,’’ Pochoda said.

State law already makes it illegal for the government to impose requirements on people that violate their religious beliefs. What’s missing, Yarbrough said, is a defense in civil lawsuits, when the fight has nothing to do with the government.

The legislation seeks to navigate between religious rights and the general prohibition against discrimination in public accommodations.

Yarbrough, an attorney, said that can extend beyond restaurants and hotels to any business that offers its services to the public, which is how it ended up being used in New Mexico against the photographer.

Yarbrough said it’s possible his proposed legislation would allow a hotel owner to turn away a gay couple without fear of suit simply because there are other nearby facilities they could turn to.

Conversely, Yarbrough said the answer might be different if that were the only hotel in town.

The proposal is virtually identical one approved last year, only to be vetoed by Gov. Jan Brewer. But she did that not because of the text of the legislation but because she was peeved at lawmakers for refusing to consider the state budget and her Medicaid expansion plan.