Interesting thought about Heinlien being sexist, I thought the more generally accepted criticism was that his women were basically men. ie they all tended to be doctor's, secret agent's able to kill you with a single blow etc, etc.
In many books the female character is the superior in the relationship, eg have spacesuit will travel, the young girl is a Genius. in starship troopers the men are all grunts whilst the women are the spaceship pilot's because of their superior reaction times and intellect.
In one of his books, I think that it is 'I Will Fear No Evil', a man is turned into a woman. I always find it interesting that a man would think that he can understand what it is to be a woman, or for that matter that a woman would think that she knows what it is to be a man.
In 'Friday', the lead character was a female agent.
There are cases where this has actually happened - gender change - such as James/Jennifer Boylan who went from male to female. I did find his/her book quite interesting, though I don't remember the title.
http://en.wikipedia.org/wiki/Jennifer_Finney_BoylanAlso, I have a friend who has gone from female to male. I went to his coming out party.
There is another case where a circumcision went awry and removed the penis. The boy, was then raised as a girl without any hormone supplements. As an adult. she finally went back to dressing and behaving as a boy, got married to a female. He eventually committed suicide. There is a book called 'As Nature Made Him' by ColaPinto. His name was David Reimer. He died in 2004.
http://en.wikipedia.org/wiki/David_ReimerI don't think Heinlein had any real experience with transgenders, though I could be mistaken. As stated above, the women are just men with different plumbing.