I really really recommend watching this:A Jihad For Love
Conservative Islamic society is dichotomous and highly patriarchal, much like older (or extremely conservative) versions of Judaism and Christianity. There are women who are inferior and there are men who are superior, nothing in between. A reflection perhaps on the strict gender roles of the mediterranean area and the east/central asia. Hence why very conservative states like Iran accepts transgenders but executes homosexuals.
More progressive secular countries with predominantly muslim populations like Turkey are less concerned about it now though.
The more masculine-oriented the society is, the more homophobic it is. Coincidence?
Off-tangent but still interesting: on the opposite end of the spectrum, the Celts (including the Gauls, the Iberians, the Gaels, and the Britons etc.) were matrilineal. Women were considered among their strongest warriors (Queen Boadicea for example) and actually have slightly more power than men in terms of gender balance (though their society had probably been originally designed to be gender-equal). Homosexuality among men was also recognized and accepted as natural and some contemporary sources including Aristotle say that Celtic men actually preferred to sleep with men.
And then the Romans came, who inherited the fiercely patriarchal society of Greece, and Christianity with it. And they too gradually became misogynistic and homophobic.