Darwin's views on gender and homosexuality were, as one biology professor puts it, "utterly conventional" for a man of his station, time and place. Another biology professor classes them as "remarkable only for their orthodoxy”.
Even in the sixth edition of On the Origin of Species, Darwin's view was that there were only two genders:
"Inasmuch as peculiarities often appear under domestication in one sex and become hereditarily attached to that sex, so no doubt it will be under nature. Thus it is rendered possible for the two sexes to be modified through natural selection in relation to different habits of life, as is sometimes the case; or for one sex to be modified in relation to the other sex, as commonly occurs."
For his views on homosexuality - which were, again, pretty much exactly in line with the thinking of his time and place -
you can read this article.
Short summary: Darwin didn't create "widespread doubt that God created male and female, as two distinct genders, for heterosexual relations alone".