You should study Papal Infallabilty before you criticize.
You should read Humane Vitae from 1968 an Encyclical predicting the moral world we live in Today. Pope Paul VI had 10k Priest leave the Priesthood inside of 2 years. Everyone mocked him but today he is obviously Correct.
The papal infallibility doctrine came about much later in Church history. It was instituted by Pope Pius IX in the mid 1800s. The same Pope who initiated the dogma that Mary herself was conceived of an immaculate conception.
Fact is popes are human and subject to sin and error just like the rest of us mere mortals.