The recent Trump executive order on sex and gender spurred some debate about the intricacies of biology of sex. Here's the relevant part:
Sec. 2. Policy and Definitions. It is the policy of the United States to recognize two sexes, male and female. These sexes are not changeable and are grounded in fundamental and incontrovertible reality. Under my direction, the Executive Branch will enforce all sex-protective laws to promote this reality, and the following definitions shall govern all Executive interpretation of and application of Federal law and administration policy:
(a) “Sex” shall refer to an individual’s immutable biological classification as either male or female. “Sex” is not a synonym for and does not include the concept of “gender identity.”
(b) “Women” or “woman” and “girls” or “girl” shall mean adult and juvenile human females, respectively.
(c) “Men” or “man” and “boys” or “boy” shall mean adult and juvenile human males, respectively.
(d) “Female” means a person belonging, at conception, to the sex that produces the large reproductive cell.
(e) “Male” means a person belonging, at conception, to the sex that produces the small reproductive cell.
The emphasis is on immutability and conception, which is sensible enough for most purposes. While one can go full analytic philosophy AKA autistic pedant on this topic, I think a better approach is found in prototype theory. In traditional philosophical analysis, one can attempt to give a clarifying definition of a key concept by listing it's exact necessary and or sufficient conditions. So if we are interested in the meaning of male versus female, we could think of several obvious candidates:
Presence of Y chromosome
Presence of (working) SRY gene
Elevated testosterone
Presence of penis/vagina, testicles/ovaries
In some extremely large percentage of humans, say, 99.999%, these and other relevant characteristics (height, voice in adulthood, beard, breast size, hair growth pattern etc.) will align and a clustering algorithm will determine which group a given subject belongs to with ~100% certainty. However, each of them admits to some very rare but peculiar exceptions related mainly to genetic defects.
The presence of the Y chromosome is a nice and clean distinction and can be fairly easily ascertained from a spit test. While one might be tempted to define woman as having 46,XX, meaning 46 chromosomes of which 2 are XX, there are women with only one X (45,X) known as Turner syndrome. One of the X chromosomes was lost during either meiosis (gamete/sex cell creation) or fertilization. There are also some women with more than 2 X chromosomes, triple/trisomy X syndrome (47, XXX). Likewise, there are some men with extra copies in various combinations: XXY (Klinefelter syndrome), XYY, XXYY and so on. All of these will develop as fairly typical members of their sex, but with some defects, often infertility, elevated crime rates (for men) and so on.
It turns out, however, that chromosomes can also occasionally split up and merge incorrectly, so it is possible to be XX and male-ish (de la Chapelle syndrome). This happens when a small region on X and Y mix incorrectly, and the SRY gene (which makes testosterone) ends up on the X chromosome, which ends up in a sperm (the Y without SRY also ends up in a sperm). Likewise, it's possible to be XY and female-ish if the SRY gene is missing or disabled. In fact, one can be XY and female-ish in a separate way even with a functioning SRY, testosterone is produced but the body is insensitive to it because the testosterone receptor gene is disabled (androgen insensitivity syndrome). The various disorders have varying phenotypic presentations, so presence of penises or vaginas, testes or ovaries may not match the other criteria. Of course, one can also cut off the various sexual organs on purpose.
Normal language does not care about such odd exceptions. For the purposes of ordinary language, a 2-way distinction that works 99.99% of the time is a very good distinction. Most useful terms like old or tall have much worse issues of graduality (is a man with a height of 185 cm tall? What about 186 cm?). Humans do not in general think of meanings in terms of necessary and sufficient conditions. This is an autistic, computer-like way of representing categories. Rather, humans use prototypes. They work like this:
A given category is represented by characteristics and typicality. A robin is a very typical bird, of average size, and average behavior and so on. Flightless birds like ostriches are very odd, as 99% of bird species can fly (says GPT 4o). Even weirder is the penguin which cannot fly, and also lives mainly in the water (and also in Antarctica). A few other birds also live substantially in the water, but they can all fly as far as I know. This probably makes penguins the least typical bird by intuitive human understanding. Of course, we have another, more modern bird concept that deviates from this original concept, namely, descent. We define birds in biology as every member of a species that descends from the Aves class, itself a subcategory of dinosaurs. A similar situation applies to mammals, where dolphins, whales, and orcas are very strange mammals, as they live in water but breathe air.
From a legal perspective, there remains the practical question of what to do with intersex persons for the purposes of government classification (censuses, passports) and certain actions (prisons). This is only really a practical question, though, and since this group of persons is extremely small, one can stick with an overall classification of a person based on presence of a Y chromosome, or a combination of several of them. It's not really a topic worth spending much time on from a public debate perspective, as it concerns a tiny segment of society which is not of particular importance. For instance, if a person who is ambiguous by some practical criteria (tall, butch self-identifying lesbian born with ambiguous genitalia) who was placed in a female jail seems at risk of raping fellow in-mates, then it is sensible to move that person to the isolation or the male jail. No philosophy is needed, just practicality. For intersex babies, usually the doctors will make a best guess at the time, which can go into the passport. If the person later decides this is not right, they can apply for reassignment, and some panel of people can look at them and see if they agree.
Biologists seem pretty clear that sex (which applies much more widely than just humans) is defined in terms of gamete type. So male and female refer to the two distinct body plans, built around the production of either the small gamete or the large gamete.
> No philosophy is needed, just practicality.
This works as long as most people are acting reasonably in good faith. Unfortunately, thanks to the wokeness memetic virus, many people are not hence the need for hard rules.