Think of it like this:
You have two tribes that are constantly killing each other. As more people are dying, the tribes are beginning to see their numbers decrease. So the two tribes come to an agreement, one tribe will be in charge of hunting, the other will be in charge of health or taking care of the women and children. The two tribes eventually see that when they aren't busy killing each other, they're prosperous and have better odds for survival on both ends. After realizing this, they decide that killing each other isn't beneficial to their society, and is therefore defined as wrong.
Here's another example:
You have mothers who would beat and berate their children, and mothers that smile and play with their children, and treat them well and even surprise their kids with a gift to boost moral. The mothers who beat and berate their children raise kids who are useless to society, either because they beat or hurt other members of their society, or are so emotionally broken that they can't even function. However, the mothers who treat their kids well raise kids to be useful for that society. The kids that were raised well live longer, are emotional sound, and will even put others before themselves. Society then sees that mothers who raise their kids tenderly, with love, are a necessity for human survival, so mothers who don't show love towards their children are outcasted, seen as taboo, and alienated, as they threaten the conditions of a stable society.
Okay, so here's another hypothetical:
You're a man who has been shown by your parents how to give gifts, think about others, and make other people feel good. You may learn from experience what doesn't feel good, like getting burned from flames, or having a friend betray your trust, and would not like for anyone else to feel this kind of hurt. You know how to hurt others, and may be called to hurt others for defense, but you generally wouldn't, not when it's uncalled for. So what's keeping this man from raping the lovely young lady across the street? It's the basic obligation to fellow a fellow human not to hurt her. That's it. You don't want to hurt her because you recognize that she is a human being, just like you are, and that is enough for a lot of people. People who don't comply to this rational are effectively alienated from society because they are a threat to maintain peace, and therefore a threat against society, and are therefore either jailed, ostracized, or both.
Okay, but why do we value monogamous relationships over polyamorous relationships? Well, people may have learned over time that people in monogamous relationships live longer.
What about slavery? We realized after thousands upon thousands of years that people who are different from us doesn't mean that they are less than us. We also learned that slavery is not beneficial for society and human progress. The North, for example, saw the value in having paid servants and workers, and made the switch from slavery to paid labor. The South, however, was culturally and economically bound to slavery, which is why they were so stubborn and threatened to leave the union.
Say that you discover that there really is no god. What do you do? Since you are no longer morally obligated to a god, are you just going to go around and rape and kill a bunch of people? Of course not! If you discover that there is no god, you become morally obligated to your fellow man.
Long story made short, our morality is learned based off of what works in favor of humanity.
But what does the Bible say about morality? Well, the Bible made a bunch of laws that clearly reflects what is beneficial to the Israelite/Jewish society at the time. In Leviticus, for example, it was morally unacceptable to shave, wear two types of linen cloth, and boil a goat in its mother's milk. In the new testament, it's morally unacceptable for a woman to speak up in church, or to work for the Pharisees. Then there are the universal laws that everyone agrees is wrong for reasons I stated above, such as not to kill or hurt others (except for rape, the bible seems fine with rape as long as the man pays the father of the woman and marries her, and slavery, slavery is also fine in the Bible as long as they're from foreign nations, but then again, what slaves aren't from foreign nations?)
So what I'm trying to say is that the Bible, in which your question implies where we should get our morality from, is not as clear cut, case in point about morality as you may think.