How does somebody else's homosexuality threaten one's own sense of masculinity though? I would think it would make prejudiced men feel MORE masculine by contrast if they equate homosexuality to femininity. Are they afraid too much time in the company of a gay man will make them feel too comfortable relaxing their gender rules? The article didn't seem to explore that question.
In-groups defining themselves by who is in the out-group would likely be one mechanism in play. And yes, I'd suspect that your idea plays into it as well; the fear that one might be found out (and remember, they aren't really sure what "gay" is, any more than they know what "liberal" is, from my personal experience.) It's simply a label for some combination of traits and behaviors that mean you will be kicked out of your whole life. That's a very non-trivial fear and not irrational at all; a rediculous proportion of throw-away teens are some variety of LBTG.