The priesthood is one of the three sacred holy orders of the Catholic Church. On average they study for eight years to be eligible to receive the Sacrament of Holy Orders. Study does not just include scholastic pursuits but also human, social, spiritual and pastoral formation.
The Catholic Church teaches that when a man participates in priesthood, he participates in the priesthood of Christ Himself. All men who, through the Sacrament of Holy Orders, have become priests participate in Christ’s priesthood; they act in persona Christi Capitis, in the person of Christ, the Head of His Body, the Church.
This is as it should be because a priest must administer to his parish. A part of his vocation is to help guide lost souls to salvation, so no matter what the person has done, or seen, or experienced, the priest has the knowledge and skills and wisdom to be able to help them.
Unless of course the sinner is a homosexual.