Punishing a person in the afterlife for sins that were already forgiven in this life has absolutely no basis in Scripture. Purgatory is entirely a Medieval conjecture.
I am very happy that you made this statement - it reveals a basic misunderstanding that allows me to open the right door of response to you. The key word, and misunderstanding, is the word "punishing." Purgatory is about purging - removing something impure, emptying out of something impure, for the sake of leaving only what is pure, holy, refined as pure gold fitting for self-offering to God.
When a loving parent decides "punishment" for his beloved child, is it to make the child suffer for the sake of pain, as if pain is a good thing, and to make the child suffer is "for his own good"? I say NO! The loving parent decides what is often called "punishment" NOT for the sake of inflicting suffering on the child, but to teach the child that his bad behavior was bad, and to point him to the good that ought to have been chosen by him. "Punishment" is to correct him, not to hurt him!
Purgatory is for purification, not "punishment": to purge the soul of all that is impure, selfish, temporal, worldly, unworthy of the eternal Beatitude of Heaven and the eternal communion in love with God the Holy Trinity, and all the Saints in Glory.
The OT speaks of this necessary purification in mystery - a truth to be revealed more clearly in the Spirit after the Church Age began. But it can be heard, for those having ears to hear:
Mal 3:2 But who can endure the day of his coming, and who can stand when he appears? "For he is like a refiner's fire and like fullers' soap;
Mal 3:3 he will sit as a refiner and purifier of silver, and he will purify the sons of Levi and refine them like gold and silver, till they present right offerings to the LORD.
When this refining is not completed in one's lifetime, "purgatory" is enabled, by the Cross and Blood of Christ, for all whose names are written in the Book of Life.
A NT passage that is more explicit is:
1Cor 3:12 Now if any one builds on the foundation with gold, silver, precious stones, wood, hay, straw—
1Cor 3: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.
1Cor 3:14 If the work which any man has built on the foundation survives, he will receive a reward.
1Cor 3:15 If any man's work is burned up, he will suffer loss, though he himself will be saved, but only as through fire.
We are saved for "good works" [Eph 2:10 For we are his workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them.]. But if a man builds on the Foundation of Christ with impure works, of an impure heart, having mixed motives in his heart, NOT "gold, silver, precious stones" BUT RATHER "wood, hay, straw" (that is, perishable and "cheap" spiritual motives) then he
will need purification if he keeps this impurity up to and into his death. "He himself will be saved" BUT "only as through fire" of refinement and purification. The impurity of soul will be "burned up" as "wood, hay, straw" would be - consumed - his soul left purified - by the "fires" of purgation.