One of the functions of the Atonement spell is to change the alignment of a willing creature. In a society that is big on redemption, it would make sense for criminals to be allowed to go free if they willingly submit to an Atonement spell by a good cleric. Obviously, this is more difficult than it sounds since it doesn't work on people that are displeased with the fact that they're being forced to switch alignments. Plus, the cleric would have to cast Detect Good to make sure it worked. However, I think it would make enough of a difference to justify it. Actually, if there is a long jail sentence, they could end up saving money... assuming your fantasy world punishes through jail instead of public flogging.