"In the United States, the federal government is prohibited from passing ex post facto laws by clause 3 of Article I, section 9 of the U.S. Constitution and the states are prohibited from the same by clause 1 of Article I, section 10. This is one of the very few restrictions that the United States Constitution made to both the power of the federal and state governments prior to the Fourteenth Amendment. "
"In the United Kingdom, ex post facto laws are frowned upon, but are permitted by virtue of the doctrine of parliamentary sovereignty."
> If, subsequent to the commission of the offence, provision is made by law for the imposition of the lighter penalty, the offender shall benefit thereby.
So while punishing or increasing the punishment for an act in the past is illegal, making the punishment lighter does apply retroactively.
http://www2.ohchr.org/english/law/ccpr.htm#art15
Now, I have no idea of how pertinent this particular treaty is (I know little about law), but at the very least it shows some consensus that lightening a punishment retroactively is not only allowable but also necessary.
The reason why you avoid it is because you criminalize actions that when were taking place the person had no reasonable expectation that it was illegal, you are essentially changing the rules of the game after it has been played.
As much as we want to change the past, we never can. So it's dangerous to consider changing an illegal act in the past into a legal one as you open the doors to the idea that you can change a legal act in the past into an illegal one. Today's 'justice' being used to convict yesterdays normality.