gender discrimination has always been a part of human history.  even chimps display what we would consider gender discrimination.  i think it most likely arose from the differences in male and female bodies and behaviors.  males were typically stronger, more aggressive, and more expendable in battles (if a male died it was not such a big loss, that just meant more females to go around, but if a female died it would hurt the population - one less female to raise children.)  this put females at a disadvantage.  this original disadvantage probably increased as societies became more complex, and the males began to craft policies which benefitted them, and gender discrimination was institutionalized.