Why does the government legally assign me a sex? What's it used for? As far as I can tell, it's only used to discriminate against me. It says I can't go into certain toilets. (Yes, right now, I break the law every time I use a public restroom and I could theoretically be arrested.) It says I can't marry my girlfriend. (Unfortunately, she says the same thing, but that's beside the point.) I can't see any advantages to assigning people a legal sex. It adds a false veneer of legality to anti-queer discrimination, and that's it.
Of course, certain forms of discrimination actually are illegal, and rightly so, but this designator is not required to advance complaints against discrimination. In fact, it hinders them by narrowing the focus of laws. Religious discrimination is illegal in the United States. The government does not ask every citizen to officially file their religion. One does not need to file paperwork with the government (nor pass a psychiatric evaluation) in order to change churches or forego them altogether. And, correspondingly, the laws regarding religious discrimination spread in all directions. A Christian can be penalized for creating a hostile work environment for a Jew and vice versa.
Some European governments do require their citizens to file their religion. These countries are not secular. Many of them have current major problems with official, legal discrimination against religious minorities. Historically, France used to collect such information, even as they changed to becoming officially secular. This data turned out to be very useful to to the Vichy government and therefore was a great help to the Nazis. France no longer collects such information, even anonymized.
So legally assigning people religions has never been used to advance greater rights than they would otherwise have. But, oh boy, has it been used to advance oppression.
In the US, citizens no longer have a legal race. Of course, there are situations where race is used for legal determinations, such as for affirmative action programs. Most racial minorities are not so-called "invisible minorities." So, for the most part, the lack of a specific legal definition doesn't really matter. Somebody looks black, they say they are on their college applications and they face racial profiling while driving their car in certain neighborhoods. The lack of a legal race registration does not change their experience. Nor does it hinder nor advance their ability to sue for redress when they face discrimination.
There are situations where somebody might not look like their listed race. Somebody has black parents but is extremely light skinned. They still qualify for affirmative action because their family faced discrimination and this trickles down to the current generation. Their family has less money now because of redlining 50 years ago. They land they lost to a lynching party 70 years ago is still lost.
When US states collected information on race, this light skinned black person would be breaking the law if they used certain bathrooms. Of it they married a person of a different legal race. Now they're an invisible minority. They can ID how they'd like and their children can ID how they'd like. They can seek redress for past wrongs through affirmative action programs or they can not. Having a legal race would not advance their freedom, but historically, it's been used to hinder it.
And now we have legal sexes. It makes it illegal to use certain bathrooms. It prevents us from marrying certain people. It helps me how?? It creates stupid situations where courts attempt to determine if it's still sexual harassment if both parties are legally male. It creates situations where sex discrimination is ok and legal if the victim is presenting as a different sex then their legally assigned one. It impedes full participation and equal rights for all because it legally privileges cisgender people. Yet, it gives them no additional protections, by which I mean they would lose no rights if we got rid of it. Heck, most people's lives wouldn't change at all. Except for transgender people, male victims of sexual harassment and abuse and everybody else who gets told that their problems don't matter and that they shouldn't exist. And loving same sex couples. The gay marriage fight would evaporate. So let's get rid of those letters on our drivers licences and ID cards. If somebody needs to report us missing, they can still describe us as white males, black females, etc, and we still have the right to lay claims to those terms. But we can marry whomever we want. Wouldn't that be better?