Warning: disgusting imagery.
When a boy is homosexually abused as a child, it often causes them to grow up gay. This is because most peasants aren't really people.
Prepubescents can orgasm. This trips the Pavlovian reward/punishment system. During gay sexual abuse, reward is associated with dick. Hence, the adult peasant turns out gay. This is the essence of grooming. The better the groomer is at associating themselves with pleasure and not associating themselves with pain, the more likely they are to be able to distort the victim's sexual impulses toward themselves.
You would think the sexual impulses would be more robust than this, but it turns out peasants are janky. It's constructed of bubble gum and duct tape. In a peasant there's nothing more to it but a bunch of physical shapes paired with Pavlovian associations. It is unlikely they are ever properly attracted to one another. The impulses aren't really sexual at all. Rather it's all a feedback loop and which way the system goes depends almost solely on the initial bias.
It's more surprising that not all victims turn out gay. Most likely this is due to overlap with social mimicry. They copy the highest-status person around them they can realistically copy, and feel rewarded for copying it with more fidelity. They don't like chicks, they just like acting the same as everyone else. They don't dislike naked dudes, they merely see folks with lots of friends modelling disgust and thus model the same.