As long as they are celibate and staying true to their vows, and the teachings of the Church, there is not an issue.
The answer to this is we can say, it depends.
Paul tells us in his epistle to the Romans
1 I BESEECH you therefore, brethren, by the mercy of God, that you present your bodies a living sacrifice, holy, pleasing unto God, your reasonable service.
2 And be not conformed to this world; but be reformed in the newness of your mind, that you may prove what is the good, and the acceptable, and the perfect will of God.
3 For I say, by the grace that is given me, to all that are among you, not to be more wise than it behoveth to be wise, but to be wise unto sobriety, and according as God hath divided to every one the measure of faith.
The call for everyone is to chastity. Not being a prude, but the marital act has a purpose, which is primarily for the procreation of children, and secondarily it binds the couple in unitive love.
If the couple is obedient to the commands of God, their relationship is blessed and their bond strengthened.
If the couple is disobedient to the commands of God, then they are outside His grace and subject to the influence of evil spirits, and since disobedience to commands regarding the marital act are mortal sin, they are cut off from the Eucharist, which is the bread of life.
The world tells us that sex is for fun and anyone in a relationship should seek to make it sexual to allegedly grow closer in love. The opposite usually takes place, as studies have shown that couples that live together before marriage are more likely to divorce, than if they had maintained premarital chastity and deferred cohabitation until married.
What I am getting to is that we have to renew our mind and think of sex as the marital act. A man shall leave his mother and father and cleave unto his wife and the two shall become one flesh. Contraception blocks the marital act as it prevents union of the two to become one flesh. Since it is a mortal sin, there is no difference in evil between a contracepting couple and a homosexual couple. Both commit grave sin
This means that we do not combat sin based on personal taste or the pleasure it gives. One cannot pray the gay away and ask God to allow him to be tempted by heterosexual sin rather than homosexual. That does not work, as God is not the author of sin or think that one mortal sin is better than another. They are both mortal
We need to renew our minds
Why I say it depends is that a homosexual person is capable of maintaining physical chastity as regards to same sex relations, but if he thinks sex as a mere pleasure from which he must deny himself, he will look for another outlet for his sin and attempt to justify it by saying at least I am not having gay sex. The demon is only conquered by obeying God and submission to proper reason, not mere self restraint.
Temperance is one of the cardinal virtues, but it may be obtained by human effort apart from the grace of God. The godly man mortifies his flesh for the glory of God. All it takes is obedience to godly reason. We may display great restraint by human effort but the devil will look for moments of weakness and we will fall
When we submit ourselves to God, He gives us superabundant grace to overcome sin and keep us safely standing on the rock which is Christ.
Like most modern men, I had a problem with lust and believed that sex was for pleasure and it was a need that must be fulfilled. I was easily overcome by sin. When I submitted to Church authoritative teaching and renewed my mind by the reason of God’s command, He gave me grace to overcome. When I am tempted by lust, I immediately direct my mind to ask, are you thinking of having a child right now? In that way, I am able to dismiss the thoughts as foolishness. That doesn’t mean that the thoughts don’t come, but they have lost their power they once had
That is not by my effort, it is God’s grace.
I say it depends for a gay priest, as what is the source of his chastity. Is it human effort or has his mind been renewed by the grace of God?
He need not pray the gay away, as their is nothing wrong with having affection for those of the same sex, and there is no command that we must have heterosexual relationships.
The command is to keep the marital act pure and bring our fleshly desires under the control of the will. This can be done is we deny ourselves, take up our cross and submit to the authority of God and His holy Church