The short legal answer is the first amendment. I could just leave it there.
Still, there are good reasons why religious freedom developed. I can't go into all of them here, but here's one for example. If somebody just doesn't want to do something, or thinks it's wrong but with finite consequences, then there are still good chances such a person will capitulate.
On the other hand, if somebody believes in an eternal soul, and that a certain course of action will damage their soul (or another's) forever, then they're very likely to simply disobey the (far less important) earthly power telling them to take that course of action. Having a lot of people in society feeling that it is absolutely imperative that they disobey the government creates chaos, as European history from the 1500s to the 1800s amply demonstrates. So it makes sense for purely practical reasons to have the religious exceptions.
Of course there are also actual ethical arguments for why it's the _right_ thing to do -- having a policy of forcing people to make those choices being bad per se, etc. -- but those are all both more complicated and more dependent on one's belief system about a number of things. (For example, in the extreme where one doesn't believe the individual matters at all as a unit of concern in political calculus, the arguments will carry no weight whatever). Some but not all of these arguments _would_ also suggest it to be a bad thing (though perhaps not always AS bad) to force a secular person to violate his moral code.
Not that it's really relevant, but this touches on what I think is one of the more important (and also silly) mistakes of a lot of the "new atheists" in respect of history and its interpretation. It's common to hear the claim that religion was one of the primary causes of violence, bloodshed, and disorder in old Europe, and to see this used as an argument against religion. The premise is true in a certain sense, but a more nuanced statement would be that the oppression of religious practice of one group by another group (religious or not) was the cause, so that (in particular) the very policies that (some/a minority) of these new atheists are urging with this argument would recreate the conditions for the violence and disorder they bemoan.
But that's just an interesting aside.