"X" indicates intersex, which is sex but not M or F.
How is this even a question given all the information that has been hashed out here about how human beings are not always fully female or male in reproductive organs? When it's not clearly male or clearly female, it's called intersex. This is not always apparent at birth, which is not even a point in the sex organ process. It begins early after conception and continues for most of gestation and not much of significance until puberty. The process can be described as "ongoing," but birth is not a change point or "milestone" in that process.
There is no rational reason to consider these cases "disorders" any more than you would call blue eyes or freckles "disorders."
Whether the people who know their own sex to be intersex want that to be known is their business. When they do, there are now more places where they can indicate X. This is not a "gender identity" although that is of course related in not only personal experience but obviously in social dynamics throughout life.
As for why a passport would have gender identity, I have no idea, but if they do that, I would also be interested in their rationale for it. Trump administration aside, government agencies don't tend to make such changes flippantly. Right or wrong, they do get legal and scientific input, especially for shit they are aware is going to hit the fan given the large chunk of bigoted right wing morons we have in our population.
The military started adapting to this reality decades ago in a lot if not all of the many and varying DoD databases within the DoD and in agencies whose databases the DoD can access.