If we believe the Holy Spirit guides the cardinals in selection of a new pope, then why have cardinals chosen, uh, “less than good” popes in the history of the papacy?
When we say that the Holy Spirit guides the cardinals in the choice of a pope, it is not meant to imply that the Holy Spirit is directly responsible for their choice. The cardinals still have free will and the ability to make errors in judgment. Joseph Cardinal Ratzinger once commented on the subject in a television interview:
It would be a mistake to believe that the Holy Spirit picks the pope because there are too many examples of popes the Holy Spirit would obviously not have chosen.
The role of the Holy Spirit is to provide the graces the cardinals need to assist their decision-making. If a particular pope is chosen who turns out to be a bad apple, the Holy Spirit will protect the Church from papal error in matters of doctrine or morals.