The doctrine of purgatory is not mentioned in scripture by name, but a place with its characteristics is certainly described in scripture, and the notion of purgatory fits with common sense.
For many people, at root of their non-acceptance of purgatory is just a misunderstanding of what purgatory is. In actuality there are only two final destinations: heaven and hell. Purgatory is just the ante-room to heaven, where those who are basically just before God have the sins still on their consciences purified from their souls. Only the truly pure (thoroughly just) can enter heaven: "nothing unclean shall enter [the new Jerusalem, heaven]" (Rev 21:27). Without purgatory, there would be a high standard indeed for any of us to enter heaven!
If there weren't this high standard, it would mean heaven would be full of people still in their sins. How pleasant would it be for the other people in heaven if you got in still reeking of your sins? Remember that it would also be unpleasant for you to know you were causing pain to the others. With all that unpleasantness it wouldn't be truly heaven would it?
St. John in one of his epistles says that there are sins and that there are serious (mortal) sins: "All wrongdoing is sin, but there is sin which is not mortal" (1 John 5:17). The less serious sins are called "venial." If you die with an unrepented mortal sin on your soul, you go to hell. If you die with a venial sin on your soul, it must be cleaned away in purgatory before you can enter heaven proper. As we mentioned above, no sin can enter heaven.
As you go with your accuser before the magistrate, make an effort to settle with him on the way, lest he drag you to the judge, and the judge hand you over to the officer, and the officer put you in prison. "I tell you, you will never get out till you have paid the very last copper." (Luke 12:58-59)
1 Corintians 3
11 For no other foundation can any one lay than that which is laid, which is Jesus Christ.
12 Now if any one builds on the foundation with gold, silver, precious stones, wood, hay, straw--
13 each man's work will become manifest; for the Day will disclose it, because it will be revealed with fire, and the fire will test what sort of work each one has done.
14 If the work which any man has built on the foundation survives, he will receive a reward.
15 If any man's work is burned up, he will suffer loss, though he himself will be saved, but only as through fire.
The suffering leading to salvation that St. Paul refers to cannot be hell, since no one there can leave, but it must be another place: a place of temporary suffering-- purgatory.
If there were no purgatory, but only heaven and hell, then prayers for the dead would make no sense. Once you enter heaven or hell, you're there for eternity. Nevertheless, graffitti in the catacombs from the persecutions of the first three centuries of Christianity includes many prayers for the dead. Early Christian writings, such as the second-century Acts of Paul and Thecla refer to the practice of praying for the dead.
See The Catholic Controversy by St. Francis de Sales (TAN Books) for an excellent discussion of this topic.