It is doctrine because it was first addressed as such during the papacy of Paul VI. The debate about women priests was going on in the Anglican communion and in the mid 1970s the Episcopal Church in the USA ordained its first female priests. In response Paul VI issued Inter Insigniores which gave a detailed explanation of why women could not be admitted to the priesthood. In that document the Holy Father explained that the matter of the sacrament of ordination (a male human being) was given by the Lord and the church did not have the authority to alter this fact. The document also explained how sexual identity is integral to the human person and to therefore to the sacraments themselves.
Paul VI’s teaching was confirmed by Pope St John Paul II’s apostolic letter Ordinatio Sacerdotalis in 1994 in which the pope clarified the teaching further saying,
Wherefore, in order that all doubt may be removed regarding a matter of great importance, a matter which pertains to the Church’s divine constitution itself, in virtue of my ministry of confirming the brethren (cf. Lk 22:32) I declare that the Church has no authority whatsoever to confer priestly ordination on women and that this judgment is to be definitively held by all the Church’s faithful.
As a side note, this was issued at the time that the Church of England voted to ordain women, so it was very much the Catholic Church’s response to that decision. I was a priest in the Church of England at the time (we came into full communion with the Catholic Church in 1995) and I remember Archbishop George Carey’s stuttering response to Ordinatio Sacerdotalis, “Errm. We will have to seek further clarification.” My response was that the pope was perfectly clear. It was the Anglican muddle that needed “clarification”.
Pope Benedict XVI, as Cardinal Ratzinger, and head of the Congregation for the Doctrine of the Faith confirmed that John Paul II’s teaching on this matter was infallible, and Pope Francis has said clearly, “The door is closed to women’s ordination.”
The question of married priests, however, is not a question of doctrine. It is a discipline, and disciplines of the church can be changed.
Pope Paul VI also issued an encyclical on the question of priestly celibacy. Sacerdotalis Caelibatus is a beautiful defense of the discipline of celibacy for priests, but he is clear throughout that this is a discipline and one from which there can be exceptions and changes.
In virtue of the fundamental norm of the government of the Catholic Church, to which We alluded above, (82) while on the one hand, the law requiring a freely chosen and perpetual celibacy of those who are admitted to Holy Orders remains unchanged, on the other hand, a study may be allowed of the particular circumstances of married sacred ministers of Churches or other Christian communities separated from the Catholic communion, and of the possibility of admitting to priestly functions those who desire to adhere to the fullness of this communion and to continue to exercise the sacred ministry. The circumstances must be such, however, as not to prejudice the existing discipline regarding celibacy.
And that the authority of the Church does not hesitate to exercise her power in this matter can be seen from the recent Ecumenical Council, which foresaw the possibility of conferring the holy diaconate on men of mature age who are already married. (83)
43. All this, however, does not signify a relaxation of the existing law, and must not be interpreted as a prelude to its abolition. There are better things to do than to promote this hypothesis, which tears down that vigor and love in which celibacy finds security and happiness, and which obscures the true doctrine that justifies its existence and exalts its splendor. It would be much better to promote serious studies in defense of the spiritual meaning and moral value of virginity and celibacy.
Should married priests and women priests always be linked together as part of one seamless progressive argument?
No. They are very separate issues and are of a completely different order.
Could the discipline of celibacy be done away with and married priests admitted? Yes, but Paul VI says this should not be a campaigning issue. instead more study, support and proper formation for celibacy among priests should be promoted.
This is why people like myself, for whom a dispensation from the vow of celibacy has been granted, are all very quick to add that we are not campaigning for married priests. If the church decides to expand the dispensations or change the discipline we accept it.
In the meantime we serve with humble gratitude for the generous welcome we have received and pray that we may, in our own way, follow the path of sacrifice and service so nobly and joyfully exhibited by most of our brother priests who have accepted the discipline of celibacy.