From what I read, I figured out that the extract below is probably the origin of the notion that we should pray for the dead. I’m not too sure about that though.
‘But that hardly accounts for the request of Monica, mother of Augustine, who asked her son, in the fourth century, to remember her soul in his Masses. This would make no sense if she thought her soul would not benefit from prayers, as would be the case if she were in hell or in the full glory of heaven.’
However, that’s not biblical!
The reality is that, at the point of death, one’s eternal destiny is confirmed. The Bible teaches that the eternal state of mankind is determined by our actions during our lives on earth. “The soul who sins is the one who will die. . . . The righteousness of the righteous man will be credited to him, and the wickedness of the wicked will be charged against him” (Ezekiel 18:20). As such I conclude that out prayers have no effect on the dead unlike the extract is putting across
Also,the main text on the link talks about nothing unclean entering heaven but it’s worthy to note that you don’t become clean during your stay in the purgatory you talk about . Rather, you become clean when you’re washed by the blood of the lamb and Jesus is made sin for you to be made righteous-all this happen on earth.
Yes, the person may sin again but it’s about the person’s willingness and effort not to sin and so if such a person died he’s not considered unclean and does not need prayers.