Gender correlates with sex, and there are only two sexes
Outside of English, many languages only have one word that means both gender and sex. Gender and sex are the same thing for many cultures. Thus, gender and sex are synonymous. There are only two sexes: XX and XY. People with XX chromosomes produce eggs and people with XY chromosomes produce sperm. There cannot be a third gender because there are only two chromosome configurations that people can have. If you are born with XX chromosomes, you are a female in sex and in gender, whereas if you are born with XY chromosomes, you are a male. Intersex people, who do not have the standard genital configuration that correlates with their chromosomes, do exist, but they are rare exceptions. Just because there are rare medical exceptions does not mean that there are more than two genders. For instance, just because some people are born with more than ten fingers does not mean that we would say, "Humans can have ten or more fingers." Rare exceptions do not mean that a rule is false. Additionally, in every other mammalian species, we have no notion of gender that is different from sex. Dogs and cats are male and female based on their biological reproductive organs. There is no scientific reason to identify sex differently in humans.
Sex is much more complicated than XX equaling female and XY equaling male. There are many people who are born with genitals that do not "match" their chromosomes, and they are not a rare exception. These people are intersex. Researchers estimate that as many as 1 in 100 people are intersex, so the condition is certainly not rare. Intersex people may not even realize that they are intersex; for instance, XX individuals may develop testes due to containing a fragment of the Y chromosome, but their XX dominance may make their external genitals and secondary sex characteristics appear entirely "female." Many people do not realize they are intersex until they seek help for infertility issues or other invasive medical procedures. In an operation on a hernia, one man, who was 70 years old and who had fathered four children, was found to have a womb. Additionally, with the help of new technologies in DNA sequencing and cell biology, researchers are finding that almost everyone, to varying degrees, contains some cells that are sexed differently than the rest of their body. The assumption that all of a person's cells contain the same exact set of genes is false. So, even someone who has a penis and testes and mostly XY chromosomes may contain some cells with XX chromosomes. Biologists are continually finding new evidence for the claim that sex is a spectrum that is mistakenly oversimplified into a binary. There is no reason to think that there are only two genders based on sex because there are actually more than two sexes.