Truthfully, it is not really about the opponent being a girl — plenty of people simply hate losing to anyone. Competition can sting no matter who is across from you.
When someone is competitive, a loss feels like a setback regardless of who caused it. Generalizing it by gender misses the point; the frustration comes from wanting to win, not from the other player's identity.
Learning to handle losses gracefully is a skill worth practicing, and it makes games a lot more fun for everyone involved.