** Clerical celibacy was a medieval invention. **
Wrong. In the Western Catholic Church, celibacy became universally practiced in the 4th century, beginning with St. Augustine’s adoption of the monastic discipline for all of his priests. In addition to the many practical reasons for this discipline — it was supposed to discourage nepotism — the celibate lifestyle allowed priests to be more independent and available. This ideal also called diocesan priests to live out the same witness as their brothers in monastic life. The Church hasn’t changed her directives for celibacy, because over the centuries she has realized the practical and spiritual value of the practice (Pope Paul VI,
On the Celibacy of the Priesthood;, Encyclical letter, 1967). Indeed, even in the Eastern Catholic Church — which includes a married clergy — the bishops are chosen only from unmarried priests.
Christ revealed the true value and meaning of celibacy. Catholic priests from St. Paul to the present have imitated Him in their total gift of self to God and others as celibates. Although Christ raised marriage to the level of a sacrament that reveals the love and life of the Trinity, He was also a living witness to the life of the world to come. The celibate priesthood is for us a living witness to this life in which the unity and joy of marriage between a man and a woman is surpassed in the perfect, loving communion with God. Celibacy properly understood and lived frees a person to love and serve others as Christ did.
Over the past forty years, celibacy has been an even more powerful witness to the loving sacrifice of men and women who offer themselves in service their communities.
catholiceducation.org/articles/facts/fm0011.html