In many cases, it is about trying to deny their inhibitions, and prove how straight they are. Sadly, with others, (like with my husband's brother) it is about hiding the fact that they had gay tendencies as a child, but don't want the world to have any clue about it not that they are adults.
You cannot always know the reasoning behind the bigots. For sure, denial is likely the truth is a great many cases. However, we cannot rule out brainwashing either.