Most religious people would say that morality comes from their religion, from believing in God and following God's precepts. Perhaps there's some truth in that since we are more likely to make better choices, to be more kind to people when we are closer to God or simply because we fear condemnation.
Despite our religious beliefs, we can't deny that, in general, non-religious people also have a good set of values. So, is religion required for morality? Did our moral values get crafted when God created humanity? For many, the answer would be yes, we get our moral values from our religion's teachings or our parents' teachings and maybe also from God himself. But if you ask a non-religious person about their moral values, they are very likely to line up with your own.
The Bible can be quite complex. There are many different opinions about some of the beliefs; or ideas from the Bible, especially those involving moral behaviors. Many things in the Bible that may have been acceptable back then may not be acceptable to everyone anymore or vise versa. As an example, Exodus 22 talks about moral principles, and it says, "You shall not permit a sorceress to live," and "Whoever lies with an animal shall be put to death." Many Christians don't believe in magic, but even those who do would not kill those who do or use magic, as the Bible may suggest, because it is morally wrong.
We all interpret the scripture differently. That's how it's passed down from generation to generation; many times, the interpretation has nothing to do with the Bible but with our own beliefs.
Morality has been part of our lives for a very long time. Times in which we lived in groups and our survival depended upon helping each other out and being mindful of others. We've always had the capacity to be compassionate, have sympathy for others, and even feel other people's suffering. While there is a variety of people with different personalities, I think ultimately, we all follow our internal moral compass and make our own choices. We take or leave religious morality according to our inner compass. Often, we choose our religion because it aligns with our own ideas and beliefs. Our moral compass is embedded in us, and it's what guides our judgment between right and wrong. However, there is no doubt that God's word helps us during moments of confusion, during moments where we don't know what to do, and we don't know if a particular thing is right or wrong. It is then that God, with his magnificent influence on us, provides us with the answer we're seeking.