I've read the lex regarding the contents of any passports issued in the EU, however it provides no explanation as to the necessity of the points. So why is it necessary that your sex be presented in a travel document? Is it because of cultural precautions towards countries where legislation makes difference between men and women in everyday life, even for tourists, or is there some other explanation for that? In the times of legal equality, why isn't someone's sex/gender their own private business?
It is an ICAO (International Civil Aviation Organization) standard, and as you know ICAO is the organization that standardize all international travel documents.
From the document ICAO 9303 (Machine readable Travel Documents) which regulates all kinds of travel documents worldwide including passports:
11/II (Mandatory), Sex, Sex of the holder, to be specified by use of the single initial commonly used in the language of the State where the document is issued and, if translation into English, French or Spanish is necessary, followed by an oblique and the capital letter F for female, M for male, or X for unspecified.
Anyway, there are some studies to remove the gender field from travel documents, such as the review from New Zealand Passport Office, things are still under study and it will take long time for this to be implemented, as such a change will require a lot of policies and procedure all over the world to be changed as well.
To answer the why part, the gender field is/was important to identify the passport's holder along with other features, some guys do look like girls with long hair and vice versa, it also reduces the risk of issuing the passport to the wrong identity or issuing multiple passports to one person, I guess the gender field is there to help in these cases. Read the review by the new Zealand passport office mentioned earlier for more details on this.
No matter how ‘gender-neutral’ our culture tends to be, many women have big issues with stripping in front of or being touched by unknown men. To a lesser extent, some men have similar issues.
It is an issue in WC or changing rooms, but when it comes to travelling, there are issue with personal control. If there is be a need for personal control, then men will ‘serve’ men and women will ‘serve’ women.
Apart from identification purposes, which are less useful in a cold climate (with many layers of clothing worn), that reason is important enough to have this data in passports.
As for privacy issues, your height and eye colour are your private business too, but this doesn’t mean that they won’t be put in your official documents. Applying for personal ID was the first time in my life that I had to think about what colours my eyes are, and it was not a trivial question.