I think the problem (illustrated nicely by your comment) is that, in reality, gender is too complex and varied to be adequately addressed by this sort of legislation. While its easy enough to this sort of law to work properly 95% of the time, its hard to come up with a real legal test that doesn't leave some percentage of people marginalized and legally required to use the wrong bathroom (either because its not the one they would feel comfortable using, or also in many cases because it would make the other users of that bathroom uncomfortable).
This being the case, and given a complete lack of any real problem with bathroom use today, one would think that this counsels strongly in favor of having no specific law on the subject at all, and relying instead on the usual social convention. (Bearing in mind, of course, that in the extremely rare event that someone really does stroll into the wrong bathroom for voyeuristic purposes, or to sexually assault someone, we already have laws to punish those people.)
It never ceases to amaze me that people who are normally so quick to declaim against any purported intrusion into individual liberties (note that I'm not necessarily talking about you here) are happy to uncritically accept the proposition that the government should have a role in telling you which bathroom you can and cannot use.