I never really watched The X-Files during its time. I saw a few episodes, but they totally creeped me out, and I avoided them. Now, I get creeped out by Supernatural and am too jaded to react strongly to X-Files, and I've started watching the series via Netflix streaming. The stories are entertaining enough, but there are some annoying themes. One of them is a transphobic plotline in the thirteenth (fourteenth if you count the pilot) episode "Gender Bender", in which an androgynous shapeshifting humanoid alien goes on a sexual killing spree.
The basic idea is that there's this cult called the Kindred, basically a stand-in for the Amish. The Kindred are aliens doing something weird with the clay in the countryside where they live, and it's forbidden for Kindred to join the human population. This one Kindred named Martin came across a discarded magazine and became infatuated with human culture to the point of leaving the commune. Martin soon became a sexual predator. The Kindred secrete powerful pheromones through their skin that make humans become extremely attracted to them upon direct contact. Martin would have sex with a human of the opposite sex, then transform into the opposite sex, kill the human, and move on. What's weird is that the transgender element of the show is so minimal it needn't even be there, let alone in the title. They could have just called it "Kindred" and had the sexy homicidal alien and the cult, and it would have been plenty interesting on its own. The only real reason it's there is to play on transphobia and be disconcerting to the viewer.
In the episode intro, we see Martin as a woman have sex with a guy and then transform into a man. Though, of course, the fact that Martin's a shapeshifter is bizarre X-file material, the conflation of femininity and masculinity is specifically used to convey a sense of freakishness. Martin then kills the unsuspecting man as he sleeps. Beyond the simple act of violence is a horror concept of having sex with this kind of freak and not even knowing it, and then getting murdered because you didn't know to watch your back. This is very problematic because there are actual transgender women who suffer transphobic violence when male sexual partners become offended at finding out they're trans and feel that the trans women are evil gay men deceiving them. There are very frequently murders on this order, and the murderers' legal defense tends to be based around the idea that revelation of the victim being trans justifies any act of rage on the part of the murderer (see a Feministe post on a specific case here). The X-Files horror story conveys the message of "OMG, do you know what you may be having sex with? It could be a man trying to trick you! Be careful next time, or you could get attacked!", which just perpetuates transphobia.
When Mulder and Scully question one of Martin's male sexual partners who was rescued (because Martin got in a scuffle with a cop and ran off), he says that his sexual partner "looked like a man". This leads Scully to conclude that they're after a "transvestite". Mulder counters that he thinks "Don Juan in there knows the difference between the male and female of the species", meaning that the suspect must logically (in this show's wacky universe) be a shapeshifter. It is clear that writers Larry and Paul Barber had no understanding of transsexuality when they penned this episode, for an easy skeptical explanation of the suspect is that they're looking for a trans woman. Instead, there's only the idea that men sometimes dress as women and fool straight men presented as the down-to-earth idea that skeptic Scully grabs at, and this is presented as what happens in reality.
The brother writers fail in queer issues all around, as they also ignore the existence of bisexuality. When Mulder first presents the case to Scully, he refers to the unknown killer with male pronouns. Scully points out that they don't know the killer's gender because victims have been of both sexes. You know, it is possible for someone to regularly have sex with both men and women because bisexuality is, in fact, a thing that actually exists. Not that I'm eager to have a character framed as a bisexual murderer given the negative connotations with that, but I'd expect the simple fact of bisexuality's existence to be at all acknowledged. Scully then adds that security cameras captured both a man and a woman, which is a valid point that should stand on its own without the fact that there have been victims of both sexes coming up first.
The Kindred aliens are fantastic sexual predators, and I suspect that the concept found some inspiration in the incubi and succubi legends. In Jewish folklore, incubi and succubi are demons that prey on people by raping them while they sleep and have been the blame of wet dreams. An aspect of their physiology is that they shift back and forth from male and female after having sex, similar to Martin's behavior in "Gender Bender". Martin acts as a sexual predator, and his pheromones function as a supernatural date rape drug. Comparison can be drawn to the Angel episode "Lonely Hearts", in which a Goa'uld-like parasite demon called the burrower jumps from man to woman to man after having sex with them and killing its previous hosts. In Angel, however, the whole transgender element is played down and isn't used to shock. The burrower is more like a sapient STD, and the message is "Be careful who you hook up with because they might give you AIDS". In X-Files, it's all about a freaky androgynous person preying on men.
Though it's stated that Martin does victimize women, we never see that. There is only Martin as a woman trying to hurt men. Because men are not typically portrayed as vulnerable and neither are women portrayed as sexual threats, I think it's reasonable to conclude that the threatening element is Martin's hidden masculinity. Martin is given a masculine name, so we know that male is his default state. When Martin is a woman picking up a guy, we view the character as really a man and preying on other men, which is problematic on so many levels.
From what I've read, The X-Files has a general problem with treatment of queer characters, so I move forward with trepidation.