The Pope can never teach against Faith or Morals
Holy Bible and Tradition proclaim that the Pope, the Vicar of CHRIST on earth, can never teach against Faith or Morals and, in fact, never a real Pope in history ever taught against Faith or Morals.
“But I have prayed for thee, that thy faith fail not.” (saint Luke 22:32)
“For thee, because I destine thee to be the head and chief of the Apostles and of My Church, that thy faith fail not in believing Me to be the Christ and the Saviour of the world. Observe that Christ in this prayer asked and obtained for Peter two especial privileges before the other Apostles : the first was personal, that he should never fall from faith in Christ ; for Christ looked back to the sifting in the former verse, that is the temptation of His own apprehension when the other Apostles flew off from Him like chaff and lost their faith, and were dispersed, and fled into all parts. But Peter, [though he was not yet Pope] although he denied Christ with his lips, at the hour foretold, and lost his love for Him, yet retained his faith. So S. Chrysostom ("Hom. xxxviii.") on S. Matthew ; S. Augustine ("de corrept. et Grat. chap. viii.") ; Theophylact and others. ... Another and a certain privilege was common to Peter with all his successors, that he and all the other bishops of Rome (for Peter, as Christ willed, founded and confirmed the Pontifical Church at Rome), should never openly fall from this faith, so as to teach the Church heresy, or any error, contrary to the faith. So S. Leo ("serm. xxii."), on Natalis of SS. Peter and Paul ; S. Cyprian (Lib. i. ep. 3), to Cornelius; Lucius I., Felix I., Agatho, Nicolas I., Leo IX., Innocent III., Bernard and others, whom Bellarmine cites and follows ("Lib. i. de Pontif. Roman").
“For it was necessary that Christ, by His most wise providence, should provide for His Church, which is ever being sifted and tempted by the devil, and that not only in the time of Peter, but at all times henceforth, even to the end of the world, an oracle of the true faith which she might consult in every doubt, and by which she might be taught and confirmed in the faith, otherwise the Church might err in faith, "quod absit !" For she is, as S. Paul said to Timothy, " the pillar and ground of the truth" (I Tim. iii. 15). This oracle of the Church then is Peter, and all successive bishops of Rome. This promise made to Peter and his successors, most especially applies to the time when Peter, as the successor of Christ, began to be the head of the Church, that is, after the death of Christ.” (Mossman, "The Great Commentary of Cornelius à Lapide", 1908, vol. 4, pg. 482-483)
“10. This consideration too clarifies the great error of those others as well who boldly venture to explain and interpret the words of God by their own judgment, misusing their reason and holding the opinion that these words are like a human work. God Himself has set up a living authority to establish and teach the true and legitimate meaning of His heavenly revelation. This authority judges infallibly all disputes which concern matters of faith and morals, lest the faithful be swirled around by every wind of doctrine which springs from the evilness of men in encompassing error. And this living infallible authority is active only in that Church which was built by Christ the Lord upon Peter, the head of the entire Church, leader and shepherd, whose faith He promised would never fail. This Church has had an unbroken line of succession from Peter himself; these legitimate pontiffs are the heirs and defenders of the same teaching, rank, office and power. And the Church is where Peter is, [St. Ambrose on Ps 40.] and Peter speaks in the Roman Pontiff, [Council of Chalcedon, Act. 2.] living at all times in his successors and making judgment, [Synod of Ephes., Act. 3.] providing the truth of the faith to those who seek it. [St. Peter Chrysologus, epistle to Eutyches.] The divine words therefore mean what this Roman See of the most blessed Peter holds and has held.
“11. For this mother and teacher [Council of Trent, session 7 on baptism.] of all the churches has always preserved entire and unharmed the faith entrusted to it by Christ the Lord. Furthermore, it has taught it to the faithful, showing all men truth and the path of salvation. Since all priesthood originates in this church, [St. Cyprian, epistle 55 to Pope Cornelius.] the entire substance of the Christian religion resides there also. [Synod. Letter of John of Constantinople to Pope Hormisdas and Sozomen, Hist., III. 8.] The leadership of the Apostolic See has always been active, [St. Augustine, epistle 162.] and therefore because of its preeminent authority, the whole Church must agree with it. The faithful who live in every place constitute the whole Church. [St. Irenaeus, Adv. Haer. III, 3.] Whoever does not gather with this Church scatters. [St. Jerome, epistle to Pope Damasus.]
“12. We, therefore, placed inscrutably by God upon this Chair of truth, eagerly call forth in the Lord your outstanding piety, venerable brothers. We urge you to strive carefully and zealously to continually warn and exhort the faithful entrusted to your care to hold to these first principles. Urge them never to allow themselves to be deceived and led into error by men who have become abominable in their pursuits. These men attempt to destroy faith on the pretext of human progress, subjecting it in an impious manner to reason and changing the meaning of the words of God. Such men do not shrink from the greatest insults to God Himself, who cares for the good and the salvation of men by means of His heavenly religion.” (Pope Pius IX, "Qui Pluribus", 9 November 1846)
“If in the difficult times in which Our lot is cast, Catholics will give ear to Us, as it behoves them to do, they will readily see what are the duties of each one in matters of opinion as well as action. As regards opinion, whatever the Roman Pontiffs have hitherto taught, or shall hereafter teach, must be held with a firm grasp of mind, and, so often as occasion requires, must be openly professed.” (Pope Leo XIII, "Immortale Dei", 1 November 1885)
“Chap. 7 ... The holy Church built upon a rock, that is Christ, and upon Peter or Cephas, the son of John who first was called Simon, because by the gates of Hell, that is, by the disputations of heretics which lead the vain to destruction, it would never be overcome; thus Truth itself promises, through whom are true, whatsoever things are true: "The gates of hell will not prevail against it" [Matt. 16: 18]. The same Son declares that He obtained the effect of this promise from the Father by prayers, by saying to Peter: "Simon, behold satan etc." [Luke 23:31 ]. Therefore, will there be anyone so foolish as to dare to regard His prayer as in anyway vain whose being willing is being able? By the See of the chief of the Apostles, namely by the Roman Church, through the same Peter, as well as through his successors, have not the c0mments of all the heretics been disapproved, rejected, and overcome, and the hearts of the brethren in the faith of Peter which so far neither has failed, nor up to the end will fail, been strengthened? ” (Pope saint Leo IX, from the epistle "In terra pax hominibus" to Michael Cerularius and to Leo of Achrida, September 2, 1053; Denz. 351]
"The eternal Pastor and Bishop of our souls" [I Pet. 2:25], in order to render the saving work of redemption perennial, willed to build a holy Church, in which, as in the house of the living God, all the faithful might be contained by the bond of one Faith and Charity. Therefore, before His glory was made manifest, "He asked the Father, not only for the Apostles but also for those who would believe through their word in Him, that all might be one, just as the Son Himself and the Father are one" [John 17:20 f.]. Thus, then, as He sent the apostles, whom He had selected from the world for Himself, as He himself had been sent by the Father [John 20:21], so in His Church He wished the pastors and the doctors to be "even to the consummation of the world" [Matt. 28:20]. But, that the episcopacy itself might be one and undivided, and that the entire multitude of the faithful through priests closely connected with one another might be preserved in the unity of Faith and communion, placing the blessed Peter over the other apostles He established in him the perpetual principle and visible foundation of both unities, upon whose strength the eternal temple might be erected, and the sublimity of the Church to be raised to heaven might rise in the firmness of this Faith. (Cf. St. Leo the Great, "serm. 4 de natali ipsius" c. 2 [ML 54, 150 C]. (Ecumenical Vatican Council, Dogmatic Constitution I on the Church of CHRIST, Session IV, 18 July 1870; Denzinger 1821).
“Moreover, what the Chief of pastors and the Great Pastor of sheep, the Lord Jesus, established in the blessed Apostle Peter for the perpetual salvation and perennial good of the Church, this by the same Author must endure always in the Church which was founded upon a rock and will endure firm until the end of the ages. Surely no one has doubt, rather all ages have known that the holy and most blessed Peter, chief and head of the apostles and pillar of faith and foundation of the Catholic Church, received the keys of the kingdom from our Lord Jesus Christ, the Savior and Redeemer of the human race; and he up to this time and always lives and presides and exercises judgment in his successors, the bishops of the holy See of Rome, which was founded by him and consecrated by his blood [cf. Council of Ephesus]. Therefore, whoever succeeds Peter in this chair, he according to the institution of Christ himself, holds the primacy of Peter over the whole Church. 'Therefore the disposition of truth remains, and blessed Peter persevering in the accepted fortitude of the rock does not abandon the guidance of the Church which he has received." (St. Leo, the Great, sermo 3 de natali ipsius c. 3 [ML 54, 146 B]). For this reason 'it has always been necessary because of mightier pre-eminence for every church to come to the Church of Rome, that is those who are the faithful everywhere,' (St. Irenaeus, Adv. Haereses I. 3, c. 3 [MG 7, 849 A] so that in this See, from which the laws of 'venerable communion' (St. Ambrose, Ep. II, n. 4 [ML 16, 946 A]) emanate over all, they as members associated in one head, coalesce into one bodily structure.” (Idem, Chap. 2. The Perpetuity of the Primacy of Blessed Peter among the Roman Pontiffs; Denzinger 1824).
“Moreover, that by the very apostolic primacy which the Roman Pontiff as the successor of Peter, the chief of the Apostles, holds over the universal Church, the supreme power of the magisterium is also comprehended, this Holy See has always held, the whole experience of the Church approves, and the ecumenical Councils themselves, especially those in which the East convened with the West in a union of faith and charity, have declared. For the fathers of the fourth council of Constantinople, adhering to the ways of the former ones, published this solemn profession: "Our first salvation is to guard the rule of right faith [...]. And since the sentiment of our Lord Jesus Christ cannot be passed over when He says: 'Thou art Peter; and upon this rock I will build my church' [Matt. 16:18], these words which were spoken are proven true by actual results, since in the Apostolic See the Catholic religion has always been preserved untainted, and holy doctrine celebrated. Desiring, then, least of all to be separated from the faith and teaching of this [Apostolic See], We hope that We may deserve to be in the one communion which the Apostolic See proclaims, in which the solidarity of the Christian religion is whole and true" (Hrd V 778 f.) [cf. n. 171 f.]. Moreover, with the approval of the second council of Lyons, the Greeks have professed, "that the Holy Roman Church holds the highest and the full primacy and pre-eminence over the universal Catholic Church, which it truthfully and humbly professes it has received with plenitude of power from the Lord Himself in blessed Peter, the chief or head of the Apostles, of whom the Roman Pontiff is the successor; and, just as it is bound above others to defend the truth of faith, so, too, if any questions arise about faith, they should be defined by its judgment" [cf. n. 466]. Finally, the Council of Florence has defined: "That the Roman Pontiff is the true vicar of Christ and head of the whole Church and the father and teacher of all Christians; and to it in the blessed Peter has been handed down by the Lord Jesus Christ the full power of feeding, ruling, and guiding the universal Church".
“To satisfy this pastoral duty, our predecessors always gave tireless attention that the saving doctrine of Christ be spread among all the peoples of the earth, and with equal care they watched that, wherever it was received, it was preserved sound and pure. Therefore, the bishops of the whole world, now individually, now gathered in Synods, following a long custom of the churches and the formula of the ancient rule, referred to this Holy See those dangers particularly which emerged in the affairs of faith, that there especially the damages to faith might be repaired where faith cannot experience a failure (Cf. Saint Bernard, "Letter (190) to Innocent II" [ML 182, 1053 D]). The Roman Pontiffs, moreover, according as the condition of the times and affairs advised, sometimes by calling ecumenical Councils or by examining the opinion of the Church spread throughout the world; sometimes by particular synods, sometimes by employing other helps which divine Providence supplied, have defined that those matters must be held which with God's help they have recognized as in agreement with Sacred Scripture and apostolic tradition. For, the Holy Spirit was not promised to the successors of Peter that by His revelation they might disclose new doctrine, but that by His help they might guard sacredly the revelation transmitted through the apostles and the deposit of faith, and might faithfully set it forth. Indeed, all the venerable fathers have embraced their apostolic doctrine, and the holy orthodox Doctors have venerated and followed it, knowing full well that the See of St. Peter always remains unimpaired by any error, according to the divine promise of our Lord the Savior made to the chief of His disciples: "I have prayed for thee, that thy faith fail not: and thou, being once converted, confirm thy brethren" [Luke 22:32].” (Ecumenical Vatican Council, "Dogmatic Constitution I on the Church of Christ", Chapter 2. "The Perpetuity of the Primacy of Blessed Peter among the Roman Pontiffs", Session IV, July 18, 1870, Denzinger 1832-1837, pages 455-456.)
“31 Q. Are we obliged to believe all the truths the Church teaches us?
“A. Yes, we are obliged to believe all the truths the Church teaches us, and Jesus Christ declares that he who does not believe is already condemned.
“32 Q. Are we also obliged to do all that the Church commands?
“A. Yes, we are obliged to do all that the Church commands, for Jesus Christ has said to the Pastors of the Church: "He who hears you, hears Me, and he who despises you, despises Me."
“33 Q. Can the Church err in what she proposes for our belief?
“A. No, the Church cannot err in what she proposes for our belief, since according to the promise of Jesus Christ she is unfailingly assisted by the Holy Ghost.
“34 Q. Is the Catholic Church infallible, then?
“A. Yes, the Catholic Church is infallible, and hence those who reject her definitions lose the faith and become heretics.
“35 Q. Can the Catholic Church be destroyed or perish?
“A. No; the Catholic Church may be persecuted, but she can never be destroyed or perish. She will last till the end of the world, because Jesus Christ, as He promised, will be with her till the end of time.
[...] “46 Q. Are we obliged to hear the Teaching Church?
“A. Yes, without doubt we are obliged under pain of eternal damnation to hear the Teaching Church; for Jesus Christ has said to the Pastors of His Church, in the persons of the Apostles: "He who hears you, hears Me, and he who despises you, despises Me."
[...] “55 Q. Can the Pope err when teaching the Church?
“A. The Pope cannot err, that is, he is infallible, in definitions regarding faith and morals.
“56 Q. How is it that the Pope is infallible?
“A. The Pope is infallible because of the promise of Jesus Christ, and of the unfailing assistance of the Holy Ghost.” (From the Catechism of saint Pius X, 1908)
"The Apostles and their successors are God's Vicars in governing the Church which is built on Faith and the Sacraments of Faith. Wherefore, just as they may not institute another Church, so neither may they deliver another Faith, nor institute other Sacraments: on the contrary, the Church is said to be built up with the Sacraments 'which flowed from the side of CHRIST while hanging on the Cross'." (Saint Thomas Aquinas, "Summa theologica", Part III, Q. 64, Art. 2, reply to obj. 3).