The main reason is that sex and gender have been intrinsically linked due to the prime directive of societies which is survival through procreation. This allowed little room for variants since they did not contribute to this basic need.
In addition religious societies did not take a kind view of this kind of aberration. Anyone inclined to differ from this model would have extreme difficulty in living authentic lives; this was especially true in Judeo-Christian societies. Some ancient cultures hold some reverence for a third gender and the fate of these people has been markedly different.
The truth is that the vast majority of people expressing gender variance are intelligent and highly functional so the issue of mental illness begins to lose traction.
The question of sexual deviance was partly answered by Alfred Kinsey during his study of the sexual habits of American Society. What came out of this m…