And yes, there have been evil popes. Being pope does not make you infallible. All humans, with the exception of Christ and His Holy Mother of course, are sinful.
The fact that Catholic human leaders have behaved like humans is hardly unbelievable. It would be far more unbelievable to claim that being a clergyman makes you sinless.
Mary was a sinner saved by grace, just like me.