Purgatory and the Christian doctrines associated with it arise from the Christian practice of relying on tradition over the spiritual text. Jesus condemned this practice: Thus you nullify the word of God for the sake of your tradition. (Matthew 15:3)
According to the Jewish Encyclopedia: Hell (sheol) is the abode of all the dead, and was viewed as divided into four  parts, two for the righteous and two for the bad. The most righteous is known as Abraham's Bosom. The two lowest are known as Prison.

The Bible refers to this prison:
 I Peter 3:18  Christ . . .also suffered once for sins, the just for the unjust, that He might bring us to God, being put to death in the flesh but made alive by the Spirit, by whom also He went and preached to the spirits in prison, who formerly were disobedient, when once the Divine longsuffering waited in the days of Noah

John 5:39-47 The Parable of the Rich Man and Lazarus At death they found themselves in two divisions of the same place. Lazarus was in The Bosom of Abraham (Paradise) and the rich man was in another division of Hell. They  could see each other and they were within speaking distance

The Apocryphal Gospel of Nicodemus:
All the saints . . . said to the prince of hell, Open now thy gates, and take away thine iron bars; for thou wilt now be bound, and have no power . . . And the mighty Lord appeared in the form of a man, and enlightened those places which had ever before been in darkness, And broke asunder the fetters which before could not be broken; and with his invincible power visited those who sate in the deep darkness by iniquity, and the shadow of death by sin. THEN the prince of hell said, He has broke down our prisons from top to bottom, dismissed all the captives, released all who were bound, and all who were wont formerly to groan under the weight of their torments have now insulted us, and we are like to be defeated by their prayers.THEN Jesus stretched forth his hand, and said, Come to me, all ye my saints, who were created in my image, who were condemned by the tree of forbidden fruit, and by the devil and death.

Purgatory is simply another word for the prison in Hell. Catholic tradition has misinterpreted thngs and rather than referring to the prison in Hell, they have created an entirely new place that fulfills the same purpose.