Consider the following thesis: (*) In a liberal democratic society, it is wrong to introduce coercive legislation on religious grounds.
Here is a simple counterexample. Suppose that the vast majority of the citizens hear a voice from God, and see lots of corroborating miracles such as the clouds spelling out a disproof of the Riemann Zeta Conjecture and a proof of Goldbach's conjecture. The voice announces that prohibiting burning coal in large quantities would decrease cancer rates in 80 years by 80%. Let us suppose that a quick review of the scientific literature finds no evidence either for or against this claim. It seems that it would reasonable and not wrong to forbid the burning of coal in large quantities on the basis of this revelation, and to do so under pain of significant penalties, and, in fact, it might be wrong not to introduce such legislation. (Sure, one could do research on the question, but the long term nature of the research would dictate that one would have to act before the research was in.) Yet such a prohibition would be coercive legislation introduced on religious grounds. Hence, (*) is false.
Objection 1: Bite the bullet—the legislation would indeed be wrong.
Response: Suppose that the voice isn't from God but from an alien scientist where the aliens had a science thousands of years ahead of ours. Then plainly the legislation would be reasonable (assuming one could rule out ulterior motives on the part of the scientist). But the only reason to listen to the scientist is that its testimony is likely true, and the same reason applies a fortiori in the case of God. Hence, if the testimony comes from God, it is even more reasonable to introduce the legislation.
Objection 2: This isn't the relevant sense of "on religious grounds." The claim that stopping burning coal would reduce cancer rates is not religious in nature. Granted, the claim is epistemically based in religious claims—the revelation of God—but the claim is not itself religious.
Response: That may be. But if so, then the prohibition on religiously based legislation prohibits a lot less than is generally thought by defenders of the prohibition. For instance, this will mean that anti-abortion legislation based on a religiously based belief that embryos and fetuses are persons will not count as religiously based in the relevant sense, since the claim that embryos and fetuses are persons is not religious in nature—it is a metaphysical or ethical claim (or some combination of these). If metaphysical or ethical claims like this were automatically religious in nature, then civil rights legislation based on the conviction that members of some class are persons and should be treated as such would likewise be ruled out, which is absurd. So on this view, (*) is not violated by legislation based on metaphysical or ethical claims that are epistemically grounded in religious claims. Then, even legislation that prohibited homosexual activity on the grounds that it is immoral, with the claim of immorality being justified by means of the Bible, would not count as religiously based, at least as long as "immoral" was understood in a non-religious way. This defense of (*), thus, undercuts what typical proponents of (*) want to use (*) for.
Objection 3: In the example given, the divine-revelation justification is epistemically based in a good publicly available argument for the reliability of the revealer, based on obvious miracles. But that is an outlandish hypothetical case: the reliability of the revealer in real-world religions is not something for which one can argue in a publicly available way.
Response: If this objection is correct, the problem isn't with the religious basing of some legislation, but simply with the legislation's not being based on good publicly available arguments. Here, I inserted "good", because in fact apologists for all the major religions do publicly offer arguments for their religions, so if the objection was the lack of argument, the objection would be unsound. Rather, the objection has to be to the lack of good publicly available argument. To make this case, one has to be in a position to show that all the apologetic arguments for the different religions fail. That is a non-trivial task (and I think an impossible one, because the apologetic arguments for Catholicism as a matter of fact are successful).
It's worth noting that even though the principle that one shouldn't introduce legislation based on something lacking good publicly available arguments may be correct, it is not a principle we really want constitutionally enshrined. The consequences of striking down all laws whose introducers (or maybe the voters for which) lacked good publicly available arguments would be really scary by everybody's lights.