Pastors are just as flawed as the congregations that they preach/minister unto and they always will be. Unfortunately though many congregations elevate their pastors almost to a position of deity and consider them above reproach or rebuke and that should not be. Most Churches have pulpit committees or procedures in place to choose pastors or the pastors are appointed by a Church board and/or assigned to a particular Church or congregation based upon their qualifications and experience. In most Churches they do screenings of their pastor and interviews where questions are ask as to what the prospective Pastor believes about certain issues and doctrines. Usually the prospective pastor is also observed in their existing Church positions and critiqued before they ever get to the position of receiving a letter notifying them they are under consideration for a certain position. Sure some could lie, and do, and there are even atheist that have taken positions as pastors (as at least 2 have admitted to in secret questionnaires where no names or identities were revealed in the Southern Baptist Convention). The reason they chose not to quit was, as they said, the money was just too easy and too much to leave.
Sadly many pastors/ministers abuse their positions and it is a job to them rather than a calling and they take advantage of their congregations treating them as some form or representative of deity. The pastor/ministers also remain accountable to their congregations and/or denomination's hierarchy and management authorities. Any congregation should and would want their pastor/minister/Spiritual leader to be not only accountable but to set the standard and conform to the examples as set by Christ himself. The Scriptures are the constitution of the Church and although they are interpreted differently with different denominations most are fairly consistent in areas of dogma but differ more in areas of doctrinal differences. Most pastors that are gay or homosexual, as there are most likely some, would (depending on the denomination) most likely conceal it and wouldn't be the flaming open examples as many think of when they think of homosexuals. Actually very few homosexuals, I believe, fit that description anyways although there are some that are very much "in your face" type people. Most I believe are just like everyone else and just want to live their lives as they desire free from judgement and abuse or oppression.