It is not uncommon for enemies and non-believers of
Catholicism to create an argument against the succession
and therefore validity of the Bishops of Rome as true successors
to Peter by proffering the history of the "bad Popes." That
argument arises from a basic misunderstanding of Sacred
Scripture.
The first response to be made to the so-called argument from
the "bad Popes" is admission that many men who held the
 position of Bishop of Rome were not holy men. Perhaps Peter
was the best model for human failure in such a leadership role.
He denied Jesus three times after being told he would do so.
Some (e.g., Peter, Judas) who are called stumble and fall.
Some (Peter) repent and are saved. Others (Judas) reject
that grace. It behooves us to remember that Jesus does not
call saints, but sinners.