A quick reminder that infallible does not mean sinless. Here are some quick facts about the papacy:
1) All of the 266 popes have sinned, including the first pope, St. Peter, who committed among the worst of sins: He denied Our Lord three times during the Passion.
2) While all of the popes have been sinners, it’s also true that many of the popes have practiced heroic virtue, rising to the heights of great sanctity. The first popes (and several subsequent popes) died as martyrs for the faith, and many popes have been canonized or beatified. Saintly popes are common.
3) Though most popes were good and holy men, there were a handful of popes who were bad, wicked and/or corrupt. A recounting of their personal sin would make your hair curl! It is entirely possible that there are popes in hell.
4) Whether saintly or evil, no pope has ever taught heresy (i.e., no pope has ever taught error as Truth). The Holy Spirit guides the Church and protects her so that the faithful will never be led into doctrinal error — no matter who sits in the Chair of Peter.
5) If you wonder how someone can speak truth while not living it, think of a math professor teaching his students perfectly correct formulas and concepts, while he himself cheats on his taxes and cannot seem to keep a balanced checkbook. Or think of a chronic adulterer who preaches that adultery is wrong. His actions are evil, but what he says is perfectly true.
There you have it. Infallibility does not mean impeccability. Just as God protected sinful men from teaching doctrinal error when writing the Bible, He also protected sinful Peter and his sinful successors from teaching doctrinal error while leading His Church.
Thanks be to God.