I know that many of us will feel angry and upset but when travelling in Asia remember that they deem your sex by physical attributes. The countries in Asia all have the rule that your IDs including passport must match your physical gender and they can refuse entry to their country. This law tends to be flexible but I warn that any Western person that aggressive attitude towards immigration officers will result in you being sent back to your city of flight origin.
In Thailand, a Thai national cannot change their sex on any IDs. Fortunately all persons are referred to as Khun and its the same for both genders. They are trying to change this law to be uniform with other Asian countries - namely, if a sex change operation has been done they will issue gender change ID and recognize you as the gender on your ID. Generally, they just don't care unless you cause trouble.
For example Hong Kong, one of the most liberal cities in Asia, recently barred two TGs from entry unless they signed a letter confirming they had a sex change operation. I understand they were impolite and aggressive when asked by immigration officers, who do not speak good English, questions that they took offence, and refused to sign the letter' Remember this is their country and you live by their rules. Normally, if you keep a low profile and not make a scene they don't care and allow you BUT is you make a scene they will bar your entry
All countries in Asia have a restroom law that you can only use toilets that match your physical gender. Even in Thailand this law exists but is not enforced.
Generally, if you behave politely and comply with their requests, this law is not enforced.