When you put it that way, it really becomes unclear to me why it should be there at all. If we're not describing what type of biological creature a person is, and simply how they can be expected to behave, it seems like we might as well write down if the person is ill-tempered or meek, and if he or she likes to dance the waltz or the tango.
Can you think of a reason why every single document about a person needs to note "what type of biological creature" they are? I'll give you a hint: there aren't a lot of good reasons for it :)
Regardless of whether or not we're documening sex, why document gender if it is only "a set of expectations about how the designated person will appear or behave"?
Really? I would say genitals as a heuristic for your legal status is probably extremely accurate.
Are you denying that humans are sexually dimorphic?
So, what sort of legal things do you think require possession of a particular type of genitals? To paraphrase the memes about gendered toys, there's nothing I'm aware of in the legal system that's operated directly by a penis or a vagina.
And really when you get into it you'll find that the things people want this information for tend to be things that aren't all that great to do (read: discriminating against people on the basis of sex, or trying to use a discrepancy between reported "sex" and identified "gender" to discriminate or deny access/rights to things).
https://en.wikipedia.org/wiki/Third_gender
And of course we've got shit going on right now in the USA like http://www.latimes.com/nation/la-na-north-carolina-bathrooms... where that sexual dimorphism (thanks in some cases to modern science and in some cases to the the non-binary nature of human genetics) where that "di"-morphism (morphism meaning shape or appearance) directly contradicts the theoretical intent of some law or another.
"Third gender" is bullshit precisely because it tries to create a preexisting dichotomy that doesn't exist. I'm not a masculine caricature. My wife is not a feminine caricature. The people you meet day to day aren't walking gendered cliches.
I still maintain that genitalia are a very good heuristic for determining someone's sex.
There have been legal issues regarding intersex people being mutilated at birth, but that "edge case" has been sorted out.
Co-option does typically detract from their struggles. By using intersex people as a tool to push a political agenda you detract from the serious issues that surround their legal and medical troubles.
You can't pretend that the actions you take while pursuing a political agenda don't have positive or negative consequences. When equality in the case that you're advocating for comes at the cost of the groups you're purporting to help, or the groups that you use as part of your political narrative, then something is probably wrong.
Second, "sex" in legal terms (for identity documents, etc.) is rarely necessarily tied to genitals or chromosomes, and more often is tied to a set of expectations about how the designated person will appear or behave. So even though the legal system uses "sex", what they're really describing is "gender".