This has nothing to do with homophobia. (If it was, then they’d forbid women to wear male clothes as well.)
It’s simply to limit the risk that comes with perverts. Sadly, in Japan there is a a rather big problem with sexual harrassment in the direction male -> female. Guys might use all kind of tricks to get into the…