What is the meaning of [the devil was sick, the devil a saint would be; the devil was well, the devil a saint was he]

People often turn to religion or promise to reform when they are ill or in trouble, only to revert to their former ways as soon as the crisis is over.