Such tainted souls, though saved ... The Church encourages us to pray for the dead since they may be in Purgatory needing our prayers. Praying for the dead is quite biblical.
A. We do not know what souls are in Purgatory nor how long they have to remain there; hence we continue to pray for all persons who have died apparently in the true faith and free from mortal sin.