Of course, the 1st Amendment does protect religious freedom and historically that has meant writing in exceptions to some laws to prevent encroaching too much on someone's right to practice their faith, even if it's out of line with majoritarian norms and laws that apply to the public at large. Recent exceptions and litigation surrounding contraception under the ACA are a good example. But it's never operated as a flat get-out-of-jail free card for operating within the public laws. Remember that making a massive change to the Mormon religion to ban polygamy (a pretty extreme state intervention) was the price of admitting Utah as a state in the late 19th century.
In the field of racial discrimination, US law has basically recognize a right to discriminate in your own personal actions or if you're doing business on an extremely small scale. If you're a landlord you can't discriminate on the basis of race but if you're renting a spare room in your house, you can basically let your racist freak flag fly, mainly, under the Fair Housing Act.
But this new turn takes things in a pretty dramatically new direction. Even judged on its own terms, it's not clear that these cases conflict with actual religious prohibitions. There is a clear prohibition against birth control and abortion within Catholicism. But I think you'd be hard pressed to find a Christian denomination in this country which bars people from serving gays in their restaurants. Call it individualized, a la carte nullification.
We should expect more of this as, in a pretty abrupt turnabout from the politics of going on half a century, conservatives and particularly the core of the GOP which drives primaries, is on the losing end of key culture war battles.