Isaiha 35:8 And a highway shall be there, and it shall be called the Holy Way;
the unclean shall not pass over it,
and fools shall not err therein.
No where in scripture does it say church leaders will not sin, being a sinful leader has NOTHING to do with teaching without error.
see also
IV. The Church is Infallible and Supernatural
About the article in crimelibrary that you posted:
There have been no more than about ten corrupt popes, giving a percentage of about 4 percent. The most infamous pope in history was probably pope Alexander VI (1492-1503).
I would say that the popes in general have shown a great deal of sanctity in their lives. 32 percent have been declared to be in heaven officially by the Church, other have shown holiness also. Only a handful have been truly corrupt. It is surely a sign of the divine institution of the Papacy that this is so.
Even those corrupt popes never taught anything against faith or morals. Pope Vigilius (6th century) had even agreed with the Emperor to heresy if he bacame pope, and when he was in fact elected, he didn't go through with it.
One out of the Twelve that Jesus chose turned corrupt. Thats about 8.33%.
!0 corrupt popes out of 266 is 3.75%
I'd call that an improvement!