Because women don't want to sit on the seats that guys have peed on.

Seriously, though, I think it's about safety concerns. One is in a vulnerable position while seated on the toilet, and there are, unfortunately, people who would take advantage of that.
Not that gendering the toilets completely prevents that sort of thing. A friend of mine had some strange woman peer through the door crack at her while she was trying to go. (And, no, it was not a quick, "Is this stall occupied?" kind of look.) I agree, though, that it is silly to gender single-occupancy restrooms.
The weirdest set-up I ever saw, though, was at a school I went to when I was 7. There were 2 single-stall restrooms in each classroom, which were separated by gender. But, the restroom that we could use when we were out on the playground was just a big room full of toilets - no stalls what-so-ever - that was used by both boys and girls.