Obligatory video; didn't watch, but biological sex is medical/scientific term, not a social one. The fact that some people are intersex doesn't detract from that, it's just part of the medical definition. Also, it's not a binary - as I just mentioned, intersex people exist and have a scientifically defined biological sex that is not in the binary of male or female.
Gender is a totally different thing, it is a social construct and also very much not a binary.
All models are approximations of reality, thus they are ideas humans make in the context of their social situation. Norms and attitudes impact what we research, how we interpret data, and what we end up believing.
While the aim of science is to get closer to the truth the end result is going to approach but never reach perfect accuracy. With gender we see the social norms all through the expression of gender in different ages, generations, socioeconomic statuses, cultures, and countries. With sex we see a flattening of what is present into a strict binary with exceptions rather than what is actually present, a range of different karyotypes, sensitivities to hormones, levels of hormone production, interactions in regulatory genes, and differing morphologies. Gender is a diverse spectrum, but so is sex, and the reason we teach the XX XY version is the same as how we teach mathematic ideas. Basic stuff first, then expanding on that idea, then going further until we have the capacity to really understand the basics, like the multiple page proof that 1+1=2. Yes, basic biology says male and female, but intermediate talks about the diverse presentations of sex.