Alan Turing's article "Computing Machinery and Intelligence" (which you can read online) is commonly interpreted as introducing the Turing test. Briefly, the Turing test is when you have two computer terminals, one controlled by a human in different room, and another controlled by a computer. A second human then has to determine which terminal is the human-controlled terminal and which is the computer-controlled terminal.
However, if you read the actual text of the article, you will notice something strange. The test Turing proposes at the introduction is actually a test to see if someone can identify a terminal controlled by a man from a terminal controlled by a woman:
The new form of the problem can be described in terms of a game which we call the 'imitation game." It is played with three people, a man (A), a woman (B), and an interrogator (C) who may be of either sex. The interrogator stays in a room apart front the other two. The object of the game for the interrogator is to determine which of the other two is the man and which is the woman. He knows them by labels X and Y, and at the end of the game he says either "X is A and Y is B" or "X is B and Y is A." The interrogator is allowed to put questions to A and B thus:
It's only at the end of the article that Turing brings computers into play. He asks what would happen if a machine replaced the man, and whether the game would change. Turing reasons that if the third human identified the human man from the human woman at the same rate the third human identifies the machine pretending to be a man from the human woman, then the machine is indistinguishable from being a human.
We now ask the question, "What will happen when a machine takes the part of [the man] in this game?" Will the interrogator decide wrongly as often when the game is played like this as he does when the game is played between a man and a woman? These questions replace our original, "Can machines think?"
Note that gender continues to play a role in the test. The Turing test, as Turing proposes it, is whether a human can identify a machine from a terminal controlled by a woman. Never in his paper does Turing propose a test where the only thing a human has to identify a terminal controlled by a human whose gender is unspecified from a computer controlled terminal.
My question is, why talk about gender at all? In particular, why talk about gender at the very beginning of the paper, and only later discuss the (presumably) real topic of the paper, computers? Note that it's extremely unlikely that this is "random" (whatever "random" means in the context of literature).
This answer has gotten a lot of answers arguing that gender has nothing to do with the test. I suppose this is a good thing: it's good to get a lot of different viewpoints. However, a possible answer that no one has considered yet is that Turing's paper may be related to various tropes about AI and gender. An answer arguing along that lines is something I would really be interested in reading.
If you're interested in writing such an answer but worried that it will get buried under the other answers here, don't worry! I'll accept the first good answer I see, which will move the answer to the top of the answers.
If you're unconvinced that such an answer exists, I would encourage you to take a closer look at Tariq Ali's excellent answer, which cites a paper dedicated to rebutting interpretations of Turing's paper that focus on gender. I'm interested in an answer that explains the arguments that Tariq Ali's answer rebuts.