That goes along with "you can only have an opinion on abortion if you're female." It's a major logical fallacy.
I've noticed that if someone says something you don't like in a way you don't like, you turn ultra-bitchy. You then try to "hit back" with some sort of knee-jerk response with an intent of shock value or trying to hurt the other individual.
Working in engineering, which, last I checked, is a male-dominated profession, you're likely to run into something similar at some point in your career. Maybe not today and maybe not tomorrow, but someday it will happen. If your reaction then matches your reaction now, you might find yourself cleaning off your deak.