Homosexuality is a kind of neuroses, or a symptom of it.
Or something like that. My theory, admittedly half-baked, is that since sex is so ancient, our wiring is too, and it is modified in primitive ways. Much like the way a duckling follows the first mother that walks by, even if she's a possum. This does us humans no credit, of course, but then sex often makes fools of us even if we do encounter the right critter.