It's about gender policing. I suspect that the man knew she was a woman, but she didn't fit his narrow definition of a "real woman," so he harassed her.
The whole "trans women in sports" thing has given misogynists an excuse to go after girls in non-"feminine" activities -- there was a man who recently decided one of the (cis-)girls on a soccer team was trans and caused such a scene he had to be thrown out.