McGreevey resigned primarily because he was facing a sexual harassment lawsuit and may have been blackmailed. (He had appointed the man bringing the suit to a state position for which he was blatantly unqualified -- in New Jersey, even a situation this personal was tied in with patronage). That said, his touching speech put the best possible face on this uncomfortable matter. He's certainly not the first closeted gay man to have his secret life revealed in an awkward manner. (Nor his wife the first woman to have to deal with having a husband who loves men).
As for openly gay statewide elected officials, I know that a number of openly gay candidates have sought statewide office, but I can't think of any who have won.