An ex of mine did the same thing. He was a pastor's son who was "straight" through college. Then he came out ... for a while. Then his family disowned him and he headed back in the closet, telling friends he was actually bi and was dating a (butt-ugly) woman for a while. Then he seemed to get over the family thing and for a while now, has been fully out-and-proud.
Sexuality is most certainly not a light switch. People's sexual identities are fluid. And some people really don't understand their own identity if it's not a standard one. I took nearly a decade to finally grasp what it meant to be pansexual, for example. Sometimes my eye strays toward me a bit more; sometimes, toward women. And it changes over time -- and, I think, in response to my relative testosterone levels, depending on when I'm in a hardcore cardio phase or not.