LITTLE ROCK, Ark. — The Arkansas legislature on Tuesday passed its version of a bill described by proponents as a religious freedom law, even as Indiana’s political leaders struggled to gain control over a growing backlash that has led to calls to boycott the state because of criticism that its law could be a vehicle for discrimination against gay couples.

The Arkansas bill now goes to the state’s Republican governor, Asa Hutchinson, who expressed reservations about an earlier version but more recently said he would sign the measure if it “reaches my desk in similar form as to what has been passed in 20 other states.” But the bill already faces a significant corporate backlash, including from Doug McMillon, the chief executive of Walmart, the state’s largest corporation, who said Tuesday afternoon that Mr. Hutchinson should veto it.

In Indiana, Gov. Mike Pence was in a difficult spot trying to satisfy both the business interests that have threatened to punish the state for its law as well as the conservatives who fought for the measure and do not want to see it diluted.

Mr. Pence has said he wants to modify the law, but he has not indicated how he could do so without undermining it. He rejected claims that it would allow private businesses to deny service to gay men and lesbians and said the criticism was based on a “perception problem” that additional legislation could fix.