If purgatory purifies souls to make them perfect for heaven, why do we pray that they go to heaven sooner? Wouldn’t it be necessary for them (considering their lives were more sinful) to clean away all their sin before they to go to heaven, even if it takes longer?
Because eternity is outside time as we know it in this life, we do not know “how long” purgatorial cleansing takes. We only know that all in purgatory will be fully cleansed from the temporal effects due their repented sin before being admitted into heavenly glory.
Because God is God, he doesn’t have to “take time” to cleanse us. He could will the souls in purgatory be automatically cleansed and they would be. If it takes some “time,” it would be more for their own sakes than his. We pray for the souls in purgatory just as we pray that those who suffer in this life be freed from suffering. The Catechism of the Catholic Church says:
Communion with the dead. “In full consciousness of this communion of the whole Mystical Body of Jesus Christ, the Church in its pilgrim members, from the very earliest days of the Christian religion, has honored with great respect the memory of the dead; and ‘because it is a holy and a wholesome thought to pray for the dead that they may be loosed from their sins’ she offers her suffrages for them.” Our prayer for them is capable not only of helping them, but also of making their intercession for us effective (CCC 958).