Oh definitely. While it’s not a given that bigoted folks are closeted, it’s worth noting that there’s been some studies showing it’s not just a joke: scientificamerican.com/…/homophobes-might-be-hidd…
Your take on it seems likely in other cases, and/or some combo of both.
That said, I would much rather a man with an erection look at me like on the right than like on the left, which was a bit more where my joke was coming from.