I'm going to re-post my summary of the issues raised in this thread. I already posted this in the other thread on this subject, but someone started a new one. Here are the Constitutional issues:
1) Equal Protection under the 14th amendment -
Religious convicts and non-religious convicts alike now have the option of eschewing a jail sentence if they go to church. This means that religious people have the option of avoiding a jail sentence by doing something they already are inclined to do, and would presumably do anyhow, whereas non-religious people have to choose between two bad options: going to jail or subjecting themselves to theological practices in which they do not believe. Consequently the two classes of people are being treated differently in the eyes of the law. Ergo, equal protection violation. The harm in this situation is specifically that they are not being treated equally under the law on the basis of religious belief.
2) Establishment Clause
The issue here is that the government is endorsing religious practice (as opposed to the absence of religious practice) by declaring it a viable substitute for a jail sentence. The harm is imposition of religion on prisoners (which is why they, and not you or I, would have standing to sue). The establishment clause wouldn't be an issue if, for example, the law included a non-jail non-religious option as well (say, community service, or a philosophy class on ethics, or something).
I) We can see that this law violates the establishment clause if we apply the Lemon test (which I think you referenced already, so I'm not going to explain what it is):
a) Is there a secular legislative purpose?
My guess is that the stated "secular" legislative purpose is the advancement of morality, or some such thing. I certainly can't think of another one. Various cases have taken issue with exactly this kind of thinking in situations where the presumption is that religion = morality. It seems pretty clear to me that the actual purpose of this law is the advancement of religion. If the goal were to advance morality, there are non-religious means of doing so (e.g. a civics class, parenting training, fostering an interest in promoting community service, etc). I am, by the way, parroting the reasoning of SCOTUS on this issue (can't remember which case - I'll look it up sometime if you're interested). To be clear, proving purpose in this context is notoriously difficult, and is frequently based on transcripts of legislative commentary on the law.
b) Is the principal or primary effect of this law the advancement of religion?
It seems pretty clear in this case that the answer is yes. The whole idea is to get people to go to church. Obviously many people (myself included) would much rather waste one day a week listening to someone talk about theology than spend weeks or months in jail. So the law fails this element of the Lemon test.
c) Does the statute foster a government entanglement with religion?
This is the only part of the test that the statute doesn't fail. Because government isn't getting involved in how religions do their thing.
Despite passing the third part of the Lemon test, because the statute fails the first two parts, it is a violation of the establishment clause.
II) Alternatively we can apply the so-called Endorsement test to reach the same result
This test asks whether or not a reasonable person would perceive the government action at issue as an endorsement of religion. This test is somewhat more controversial, but it seems pretty clear that by providing a religious alternative to a jail term, and only a religious alternative, a reasonable person would perceive this law to be an endorsement of religion at the expense of secularism.
3) Free Exercise of Religion
This is the weakest of the three Constitutional arguments. Given that the first two are so much better, I'm mostly only adding it because I've already brought it up. The reasoning here would be that by forcing non-religious people to choose between going to jail or engaging in religious practices (i.e. going to church) that they don't condone, those people are being coerced into rescinding their own religious freedom. You're going to argue here that it's a choice to go to jail or participate in religion, but once again, this has the effect of favoring religious practices over non-religious practices. The test used, by the way, is whether or not this is a "neutral law of general applicability." Examples of neutral laws that do affect religious exercise but do not violate this clause include health code laws related to how meat is slaughtered (which can affect, e.g., Kosher practices, etc) and laws related to banning drug use by certain public employees (which can, and have, impacted the religious practices of certain Native American traditionalists).