I know from my own life experience, that repressed sexual expression leads to externalizing that repression and projecting it upon others. Fear, anger, and self loathing is the bottom line. When I finially was freed of the Jw beliefs, and then later came out to friends (actually, I was outed), I had a new awareness dawn on me one day. I was doing occational work for a very religious Baptist fellow, and I started to notice that he was always ranting about evil homosexuals. That stuck in my head, and then I thought back to other people I knew that were very vocal about their feelings for homosexuals. And then I remembered myself, and how I spoke when I was younger and repressed, and then it all clicked.
The following is from the Wikipedia page about homophobia. I put some in bold.
Internalized homophobia (or ego-dystonic homophobia) refers to homophobia as a prejudice carried by individuals against homosexual manifestations in themselves and others. It causes severe discomfort with or disapproval of one's own sexual orientation.
Such a situation may cause extreme repression of homosexual desires.  In other cases, a conscious internal struggle may occur for some time, often pitting deeply held religious or social beliefs against strong sexual and emotional desires. This discordance often causes clinical depression, and the unusually high suicide rate among gay teenagers (up to 30% of non-heterosexual youth attempt suicide) has been attributed to this phenomenon. 
The theory attributing higher incidences of depression, alcoholism and other self-destructive tendencies among homosexually oriented individuals to internalized homophobia has been put into question by groups such as NARTH that oppose the American Psychiatric Association's 1973 decision to remove of homosexuality from the DSM. Studies of gay people in societies such as Sweden, New Zealand and the Netherlands found similar incidences of such behavior.  
The label of internalized homophobia is sometimes applied to conscious or unconscious behaviors which an observer feels the need to promote or conform to the expectations of heteronormativity or heterosexism. This can include extreme repression and denial coupled with forced outward displays of heteronormative behavior for the purpose of appearing or attempting to feel "normal" or "accepted". This might also include less overt behavior like making assumptions about the gender of a person's romantic partner, or about gender roles. Some also apply this label to LGBT persons who support "compromise" policies, such as those that find civil unions an acceptable alternative to same-sex marriage. Whether this is a tactical judgement call or the result of some kind of internal prejudice (whether in a cause-and-effect fashion, or definitionally) is a matter of some debate.
Some claim that some or most homophobes are repressed homosexuals, but this claim is somewhat controversial. In 1996, a controlled study of 64 heterosexual men (half claimed to be homophobic by experience and self-reported orientation) at the University of Georgia found that the allegedly homophobic men (as measured by the Index of Homophobia)  were considerably more likely to experience more erectile responses when exposed to homoerotic images than non-homophobic men. 
 Fear of being identified as gay
Theorists including Calvin Thomas and Judith Butler have suggested that homophobia can be rooted in an individual's fear of being identified as gay.  At least one study indicates that homophobia in men is correlated with insecurity about masculinity. 
They have argued that a person who expresses homophobic thoughts and feelings does so not only to communicate their beliefs about the class of gay people, but also to distance themself from this class and its social status. Thus, by distancing themself from gay people, they are reaffirming their role as a heterosexual in a heteronormative culture, thereby attempting to prevent themself from being labelled and treated as a gay person.
This interpretation alludes to the idea that a person may posit violent opposition to "the Other" as a means of establishing their own identity as part of the majority and thus gaining social validation. This concept is also recurrent in interpretations of racism and xenophobia.
Nancy J. Chodorow states that homophobia can be viewed as a method of protection of male masculinity. 
Various psychoanalytic theories explain homophobia as a threat to an individual's own same-sex impulses, whether those impulses are imminent or merely hypothetical. This threat causes repression, denial or reaction formation. 
...you know who you are.