Your personal belief that it isn't valid to be anything other than male or female is anything out progressive and it breaks my heart that there are people who still have these views.
Male/female refer to sex. Gender is based on societal expectations and experiences and as such, is not "real", in the sense that it is not a fixed concept.
From www.medicalnewstoday.com/articles/232363#gender-identity-and-expression:
Sex refers to biological characteristics. Gender refers to the individual’s and society’s perceptions of sexuality and the malleable concepts of masculinity and femininity. So other than a small number of intersex people, people are male or female.
Gender, on the other hand, is a societal concept that varies over time and by culture. Gender tends to denote the social and cultural role of each sex within a given society. Rather than being purely assigned by genetics, as sex differences generally are, people often develop their gender roles in response to their environment, including family interactions, the media, peers, and education. Gender roles and gender stereotypes are highly fluid and can shift substantially over time.
The World Health Organization (WHO) defines gender as:
“Gender refers to the socially constructed characteristics of women and men, such as norms, roles, and relationships of and between groups of women and men. It varies from society to society and can be changed.”