humans evolved on the African savanna. Our ancestors needed to live in social groups with multiple males to defend themselves. To do that the males needed to bond with one another and they could not afford to fight among themselves for the right to have sex. Imagine how a male will feel if he is not allowed to mate, would he then come to the aid of a bully that monopolized mating with all females if he is attacked by, say, a lion? or would he be glad that the bully is killed so that the other males may have a chance to have sex?
As a result, just like lions, early humans do not fight over females. instead they take turns having sex with the same female(s). Females too like having sex with multiple males because her child is less likely to be killed later. Of course we do not assume that is how females thought, but evolution gives them the instinct to do what is beat for her in terms of number of descendants that they leave behind. evolution also evolved ways to encourage females to do what is good for them evolutionarily, by giving females the ability to experience multiple orgasms. The reward of pleasure therefore encourages females to have lots of sex and with lots of different males.
As a result early humans were promiscuous. To father young, males in a promiscuous society needs to have a long penis, so that they can put sperms close to the uterus, or else their sperms may not reach the egg before the sperms of other males have done so. further, the human penis is shaped in such a way as to remove sperm from the vagina. therefore even though males did not fight to have sex, they do fight a war of the penis to father children.
All that changed when agriculture was invented and people no longer live a nomadic hunter/gatherer lifestyle. A man can settle down and farm a plot of land and grow enough to raise a family. whenever animals provide male parental investment in nature, they demand monogamy. That is because it is disadvantageous if a male raises the young fathered by other males. It is called cuckoldry and it is negatively selected. Therefore humans have only been monogamous since the invention of agriculture about 10,000 years ago. Meanwhile females still have the instincts to enjoy sex, and do it with more than one men. In order to change that tendency, humans have used culture to discourage polygamy by females. Marriage was invented so that females now are forced to have sex with only their husbands, and adultery was often punishable by death. As a result, penis size has shrunk in some societies. No longer do men have to compete with other men with a long penis in order to father children. Much more important is the ability to grow enough food or make enough money to raise kids and also the ability to stop one's woman from having extramarital sex.