1. What are the presuppositions of purgatory? The basic argument is twofold: (i) sinners cannot enter heaven; (ii) Christians are still sinners when they die. Hence, there must be a period of postmortem sanctification to render them sinless.
2. But what's the basis for the assumption that sinners cannot enter heaven? I can think of roughly three or four prima facie arguments:
i) Rev 21:27 is stock prooftext.
However, even if we grant the relevance of that passage to the issue at hand–which is dubious (see below), that of itself, doesn't explain why it's the case. It's just a statement of fact. What's the underlying rationale?
ii) It might be argued that sinners cannot enter into the presence of God, the heavenly angels, and the saints. That's incompatible with God's holiness (1 Jn 3:2), and the general holiness of heaven.
iii) It might be argued that the saints in heaven can never commit apostasy. Never lose their salvation or fall from heaven. But that must mean they are sinless.
iv) It might be argued that sin is incompatible with heavenly bliss (e.g. Rev 14:13; 7:16-17; 21:4).
3. Let's run back through the list:
i) One ambiguity is how the word "heaven" is defined. Is that used to denote the intermediate state of Christians or the final state of Christians? On the face of it, Rev 21:27 has reference to the final state, not the intermediate state. In the narrative of Revelation, this is after the return of Christ and the final judgment. So it doesn't speak directly to the period between death and the final state. In the same book, Rev 6:19-11 is more germane to the intermediate state.
Therefore, Rev 21:27 doesn't prove that sinners can't enter heaven, if we're using heaven as a synonym for the intermediate state of Christians rather than the final state of Christians. Mind you, this doesn't mean sinner can enter heaven, in that sense. But one needs a better argument. It could be true, but perhaps we lack sufficient information to say whether or not that's true.
ii) The problem with this rationale is obvious. Jesus mingled with sinners. God appears to sinners in theophanies. Seers (e.g. Isaiah, Daniel, John the Revelator) have visions of heaven, which seem to be (temporary) out-of-body experiences. So there doesn't seem to be any impediment in principle to God's compresence or Christ's compresence with sinners in heaven. Likewise, heavenly angels appear to sinners. Sinners survive these encounters.
iii) This is more interesting. From the standpoint of Reformed theology, God preserves the elect from apostasy even though they can still sin. So, in theory, people in heaven could still be sinful, but not be in danger of falling from heaven. I'm not saying that's true, just addressing the logic of the rationale.
In addition, even assuming that someone can become sinless through a gradual process of sanctification, which is not a given, it's unclear to me how any incremental process could make it impossible for someone to sin. Impeccability seems to require a special act of grace by which God preserves an individual from sin. But if God can instantly render a Christian impeccable, then, a fortiori, God can instantly render a Christian sinless. If God can do the greater, he can do the lesser (argumentum a maiore ad minus). That, however, nullifies the rationale of purgatory at one stroke.
iv) That's more complicated. Certainly heaven is supposed to be an improvement over life in a fallen world. A better place (Heb 11:16). Sin is a source of misery.
Again, though, it may be necessary to distinguish between the intermediate state and the final state. The saints in Rev 6:9-11 don't seem to be blissful!
There are various ways in which heaven (i.e. the intermediate state) could be a great improvement, could be a far happier condition, without requiring the saints to be sinless. For instance, there will be no crime in heaven. No persecution. There won't be the opportunity to commit certain sins.
My point is not to deny that the saints are sinless. My point, rather, is that the supporting arguments fall short of demonstrating that contention. From what I can tell, traditional theological assumptions on this question are underdetermined by the available evidence.