The second of Franklin Delano Roosevelt's Four Freedoms is the freedom of worship. This freedom is, of course, codified in the First Amendment to the United States Constitution, in which establishing a state religion is forbidden and the state may not impede people's rights to freely exercise their respective religions. The only law that comes to mind is one that has been under discussion during this presidential campaign, which could be said to have been referenced in the comments of one candidate who seeks to keep all Muslims out of the United States. There is a Supreme Court decision that you might be thinking of, that some people will argue interferes with the freedom of religion, but I disagree with their position on this. You will have to decide for yourself what you think.
If we place a religious restriction on immigration, we are clearly interfering with Roosevelt's second freedom. If we are going to be a nation that allows immigrants at all, the government cannot pick and choose which religions to allow in. People who are here lawfully have constitutional rights, too. And it is a slippery slope once we prohibit people of one particular religion from emigrating here. From there, it would be quite easy to make Muslim worship completely illegal, along with Hinduism, Judaism, and whatever other minority religion we choose to eliminate. We might say this can't happen today, but it happened in the Spanish Inquisition, it is happening now with ISIS, and it has happened in plenty of other times and places, too. Once we choose one religion to stigmatize, it is easy to keep going down that path.
In Obergefell v. Hodges, (2015) the Supreme Court held that gay people have the right to marry one another, with the same protections and privileges afforded by law to heterosexual couples. The argument is that anyone who believes, as a matter of religion, that the LGBT community is an "abomination unto God" is being denied the right to practice his or her religion by signing a gay marriage license or by doing the photography or flowers for a gay wedding. The decision is also disingenuously held to stand for the proposition that clergy must perform gay marriage ceremonies.
There are a few separate threads to these arguments that must be untangled. First, signing a marriage license is an act of a public official who has no freedom whatsoever to exercise religious judgement on the job. Second, if an establishment is open to the public, if we allow it to discriminate on the basis of sexual preference, there is nothing to stop it from discriminating on the basis of race. Both are immutable characteristics. This is another slippery slope that is antithetical to American values. Most of us have done business with people we do not approve of in one way or another from time to time. This does not mean that we sanction them in any way whatsoever. A public entity needs to be open to the public, not just to those whom we approve of. This in no way detracts from someone's exercise of religion. Third, any law that would force any member of the clergy to perform any wedding at all would be a violation of the First Amendment. Religious institutions have the absolute freedom to delineate whom they will admit, whom they will marry, and whom they will serve. No minster, priest, rabbi, or imam can be forced to officiate in any marriage ceremony in the United States.
I am not sure if the Supreme Court decision is the "law" being contemplated in your question or if perhaps the proposals of one presidential candidate are what you have in mind. Certainly, the response of Congress has been largely negative regarding this suggestion. While there may be those who believe that the court decision interferes with their second freedom, the fact is that a converse decision would have interfered with the religious rights of many gay people, who would have had to forego the sanctity of marriage. If someone believes there is something religiously wrong with being gay, that person can be assured that no decision or statute will ever force that person to engage in any gay behavior.