Peter Kreeft explains it this way:
Originally Posted by The Mighty Sword
I am not a particular fan of the argument, to be clear.
Purgatory exists because God is both just and merciful.
Purgatory is "like a refiner's fire" (Mal 3:2). It refines and purifies those who at the moment of death are neither good enough for an immediate heaven nor bad enough for hell. "All who die in God's grace and friendship, but still imperfectly purified, are indeed assured of their eternal salvation; but after death they undergo purification, so as to achieve the holiness necessary to enter the joy of heaven" (CCC 1030). "The Church gives the name Purgatory
to this final purification of the elect, which is entirely different from the punishment of the damned" (CCC 1031)...
The existence of purgatory logically follows from two facts: our imperfection on earth and our perfection in heaven.
- At the moment of death, most of us are not completely sanctified (purified, made holy), even though we are justified, or saved by having been baptized into Christ's Body and having thereby received God's supernatural life into our souls, having accepted him by faith and not having rejected him by unrepented mortal sin.
- But in heaven, we will be perfectly sanctified, with no lingering bad habits or imperfections in our souls.
- Therefore, for most of us, there must be some additional change, some purification, between death and heaven. This is purgatory.
... Unlike heaven or hell, purgatory is only temporary. Purgatory takes away the temporal
punishment still due for our sins after our Baptism, faith, and repentance have already saved us from the eternal
punishment due to our sin, that is hell.