Contradiction

“Your right to your religious belief ends when it violates the law.”
Judge Thomas Gossett

“Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof;”
– The First Amendment

There would seem to be a certain dichotomy here. How can a religious belief violate the law, if it is not permitted for laws to prohibit the free exercise of religion?