An evolutionary argument could be made that it's because a man that does extremely risky things (like, say, sleeping with every woman that he is able to) can spread his genes far and wide as a reward for such behavior (he'll have a lot of children). Whereas a woman engaging in the same behaviors can only be have one child every nine months, and for most of human history, every pregnancy carried with it a high risk of death, so there was a pretty hard limit to the "payoff" for such risk-seeking in women.

Put another way: as far as natural selection goes, women undergo a selection process that, depending on their fitness (and chance, of course), replaces them with maybe 0-6 copies of their genes; men, on the other hand, can be replaced with many more (even if, on average, they are not, the distribution is much wider), and those that hit the "jackpot" will tend to very quickly spread their genes throughout the pool.

The extent to which this actually happened is unclear; I don't know off the top of my head if there are good ways to investigate the landscape of possible fitness outcomes based on only the genome, but if this did happen to any significant degree we'd likely find that wild genetic variations stabilize more quickly on the Y chromosome than on the X (we'd also find that wild variations elsewhere, good and bad, tend to spawn more often from males rather than females, but I'm reasonably sure there's no way to see that without a full DNA history because any genetic material not on the Y chromosome ends up in females as well as males).

I'm currently very interested in this because I think it might be a useful approach in genetic algorithms to cut a balance between the two common strategies for selection - the male replacement strategy (weighted by fitness) is very useful for spreading good characteristics quickly through a population, but the female one (flat selection via a fitness cutoff) is good at preventing one particular trait from forcing fixation of all the genetic cruft that happens to sit beside it.

For instance, imagine that we're evolving zubbins, and each one has two traits, color and size. It turns out that the optimal zubbin for this environment is red and tiny, where "red" is extremely important, and "tiny" less so. If we started out with a population mixed between tiny green zubbins and large red zubbins, a fitness-weighted reproduction strategy would cause the large red zubbins to very quickly overtake the entire population, and we'd lose the "tiny" trait altogether, and the only way it could be recreated would be by mutation (which is a relatively weak evolutionary force, typically). On the other hand, if half the population was selected by a cutoff, there are more "spots" available for less fit zubbins, some of which will be tiny, so eventually we'll see some tiny red zubbins, which is what we're after, and these will still reach fixation quickly enough because of the massive benefit that the male offspring will have.

If only the male reproductive strategy was in play, the crappy "large" trait hitchhikes along with the useful "red" one, destroying the "tiny" trait altogether; conversely, if only the female strategy was happening, fixation would take much longer.

What I'm not sure about, though, is whether there's any real benefit to separating the two strategies (i.e. creating both male and female classes) rather than coming up with one method that cuts a good balance between them (offering a slight extra benefit to highly fit creatures, but just setting a cutoff at some point). There are a lot of other reasons that sexual reproduction is evolutionarily useful in the real world, and many of those don't carry over to code.