I want to note that the way the sex binary looks like it’s present throughout the animal world is that white scientists have a terrible habit of labeling everything “male” or “female” even when it makes no sense.
Like, by any reasonable metric, bees have three sexes: drone, queen, and worker. Workers are only labelled female because someone couldn’t abide the idea of something not being either one or the other.
And before someone calls “genetics” there are many species where both sexes have the exact same genetics, and even many where individuals can change reproductive capacity at will, and scientists suddenly have no problem calling the ones who grow eggs “female” even though they were “male” two weeks ago.
Some species of mammals reproduce asexually. They have only one sex. It is still called “female” because it makes babies even though one might reasonably ask why even make the distinction when every single individual makes babies just the same.
The whole ‘Lesbian Lizards’ thing bothered me for that reason. They’re not Lesbian. They’re reproducing asexually. They’re not necessarily female, just because they lay eggs, also.
The type of sex being discussed in the OP, gametic sex, is determined by gamete type. If the model organism (the ‘standard’ version without, say, severe gonad injury or anything else that causes non-typical function) of the appropriate type can produce gametes that contain the major cell structures used by the cell post-fertilisation, it is female. If it cannot produce these gametes and instead produces gametes that are just DNA donor vessels, it is male. If it can produce both, it is hermaphroditic. Worker bees and whiptail lizards (at least the kind who wiped out all the males) produce the first type of gamete and never the second, so they are female. (Gametic production is of course rare in worker bees because of hormonal suppression but this does not affect their sex. This is further reinforced by their status as a different phenotype of the clearly female queen bee, although I have heard some interesting arguments that if we’re going to designate based on that, then all sex-changing fish should be considered hermaphrodic.)
This is why bacteria have arbitrarily named mating types, not male/female sex designations. (They are given a female grammatical gender to make communication in English, which was much more gendered when they were discovered, easy, but they are not of the female sex.)
Anybody interested in single sex species should check out these clams, which are a male-only species. They hijack the eggs of another species for nutrients and organelles to produce more sons. It’s really cool.