How many of you have jobs where you occasionally just have to suck it up and do something you dislike? I think all the closet gays in the republican party are doing the same thing. Being gay doesn't define your entire life nor do gay-issues define a politician's entire job.
When we are stuck with a two party system, unless you are a brainwashed "my party, right or wrong" type, nobody will be in complete agreement with either party platform. So these guys end up having to toe the party line on all the gay politics but probably actually believe in a lot of the rest of the party platform.
Unlike most of our jobs, a politician's job is 24x7. So they can either stay in the closet and keep their job, or come out and lose it and lose the chance they have to make a difference with respect to all of the other issues that they do believe in.