The truth is that it isn’t in Scripture. The church accepts the premise of Purgatory from the Magisterium. Jesus does not speak of such a place in Scripture. Again, we have to look past the Bible and lean on what the church says.
Actually, the belief in the place of the righteous dead, and those souls “imprisoned” pre-dated the Catholic Magesterium by at least half a millenia. Jesus accepted the Deuterocanonical books as inspired, and therefore, so did the Apostles. We see praying for the dead in the book of Maccabees long before the Church was established.
What “place” do you think Jesus was speaking about when He said “you will not get out until you have paid the last penny”?
Who are the souls “in prison” and why were they there?
No, the Church does not “look past the Bible”. The CAtholic Church produced the Bible, so everything in it is consistent with the Catholic faith. If it were not, it would not have been included. However, the Church never intended for the Scripture to be the Sole or Final rule of authority in matters of faith. That role belongs to the Teaching of the Apostles.
I was meditating on sanctification today, and found this passage relevant:
Rom 6:21-7:1
22 But now that you have been set free from sin and have become slaves of God, the return you get is sanctification and its end, eternal life. 23 For the wages of sin is death, but the free gift of God is eternal life in Christ Jesus our Lord.
The Apostles taught that we enter into salvation at baptism, and that we work out our salvation while we are here on earth. We are made holy, made worthy of the promises, created in Christ for the good works that He has prepared beforehand, that we should walk in them. At the end of sanctification is eternal life. This passage reflects the Apostolic Teaching that sanctification is not separated from justification, and glorification. They are all parts of salvation.