I'm sure a lot of fun, unintelligent comments will follow, but this is actually a valid question and I like the way you approached in asking it.
Of course, no one knows for sure and it is different for every person - this is very obvious but must be stated because one will quickly get criticized for any kind of reasoning that one comes up with.
I think the link is due to many reasons, but the major ones being 1) genes, 2) history/tradition, 3) following your own kind.
GENES
Based solely on my experience with people and not including any research or having read any studies, I notice that homosexual men are more artistically-inclined. This has to do, I think, with us wanting to detach any sort of association with what "straight" people do. The "gay connection to theater" could also been seen as "the straight connection to construction." In both cases, straight men do theater and gay men do construction, but one can't deny the majority of men in theater are homo and the majority of men in construction are hetero. Again, not based on statistics but personal observation. This ties in with:
HISTORY/TRADITION
The theater, and the arts in general, have always been a venue for freedom of speech and social commentary. Books, radio, television, film, theater, poetry, music, and performance art have always been a platform for artists to "change the world." (And with that also a history of censorship, yes.) But in a world where you couldn't be gay, it can be more acceptable on stage. In a world where you couldn't be black, it was acceptable on stage. The theater has always been kind of groundbreaking in that you could break social boundaries there before you could in other areas of life.
FOLLOWING YOUR OWN KIND
But for whatever reasons gay men flock to the theater, I think many get into it because they grow up realizing that gay men do theater. Again, speaking of personal reflection and observation of the world, I noticed that gay men go where gay men can be found and straight men go where straight men can be found. We are drawn to each other for all the reasons there are to be drawn to another (security, attraction, society structure). Have you ever noticed during the first day of school that the white girls usually sit in one corner of the classroom, the white guys in another, and the blacks in another? It's just our natural tendency.
I got into theatre because I enjoyed watching it and wanted to be a part of creating it. For me, it was all personal reasons. So if I would have to ask what the connection is between me being gay and my profession, I could only imagine attributing it to genes.
"The Spectacle has, indeed, an emotional attraction of its own, but, of all the parts, it is the least artistic, and connected least with the art of poetry. For the power of Tragedy, we may be sure, is felt even apart from representation and actors. Besides, the production of spectacular effects depends more on the art of the stage machinist than on that of the poet."
--Aristotle