It seems, at least from "Qpid," that the Qs' humanoid appearance is just for show. The "main" Q is not really a male, for example. After all, Q tells Picard in the episode that given different knowledge, he would have first appeared to Picard as a female.
However, in Deep Space Nine's "Q-Less," Q apparently finds a female civilian attractive, and in the Voyager episodes, we find that Q has been in a relationship of sorts with (Female) Q.
Even the lowly J'Naii consider species with different genders to be less evolved (I wonder what they'd think of The Traveler or Species 8472), so why would the Q, of all species, apparently have gender?
I suppose it's possible that Q don't really have gender, but lesser lifeforms can't "see" this truth of the Q any other way. Energy beings still "mate," I think, so maybe the only way mere mortals can understand this aspect of a Q's life is through a gross approximation.
I'm looking for an in-universe reason, of course.