Virtues change over time. You can't judge 16th century morals with our current view of virtues.
> how badly behaved a large number of popes have been
This is from our point of view. I think there should be legal guardrails so that gov and church don't mix, but this kind of moral separation is the kind of thing that created the conditions for the holocaust.
Of course the other extreme is to have a theocracy, so everything in balance.
> The more cynical read is that the Papacy has for a very extensive period been about increasing the personal worldly power of the Pope and his close associates.
This is a problem in every institution, it needs power and power corrupts absolutely. But the pope dedicates his life for a doctrine that if correctly applied presents a really important counterweight for the current system of morals that reduces the individual to what it can produce. This is why I think this is an important period to listen to our religious leaders, not because they have the answers, but because first they are deserving of some level or respect and second just because they have incentives that are different from our political leaders.
Are they?
> because they have incentives that are different from our political leaders
Do they?