There is great debate regarding the matter of morals/ethics, and this particularly true whenever there is interaction between religiously driven portions of a culture, and those who maintain no religious opinion or even subscribe to atheism. That cultural clash occurs often on this forum and others like it.
Believers in God often attribute moral choices with godliness. Yet, among billions who have lived without any attachment to God in the particular sense that is often considered the driving influence [Christianity, Islam, Judaism, or other organized religion] there have always been men and women whose 'moral character' is above reproach, even when measured with a black/white index of religious thought.
Morality holds an arbitrary position among mankind. Depending on where you live, what time period, and the basic influences of that time and place, you might be considered moral or immoral in life choices. Certain matters have always been taken to be 'immoral' by nearly all humans- taking of human life by murder [and that definition changes under venue or time], treason against the community in which one resides, deviance that causes harm to others. Certain actions, judged by community at large as 'immoral' carry no harmful aspect in the sense of personal harm to either the individual who chooses to act that way or outwardly to the community itself. Some of these 'morals' have been seemingly influenced primarily by the religious community that holds sway. But perhaps not. Some evolutionary supporters accept that similar moral stands might have accrued from the resultant shortfall of some behavior to the community at large. For instance, while believers in God lay claim to homosexual union being wrong because it runs against their Holy Writ, some evolutionist hold that early human morals that discouraged such behavior may have arisen from a much more pressing need to populate the region and expand and protect the community at large. Homosexual unions do not result in children that can carry on the needs and desires of the community or to care for the parents. With growing affluence many communities relax this view as it no longer protects the community from the inherent 'dangers' of underpopulation. Parents no longer are required to have many children to shoulder the burden of caring for them in old age - other modern means of support have largely supplanted that need. Yet the community may hold to the religious influence for some time before social evolution allows them to release the moral chains and for the community to respond in a secular fashion.
Morals carry with them a great deal of subjectivity, and are generally not very objective. The same community that will uniformly condemn murder [though that community may be well divided on the punishment that should be meted], will quite likely allow, or even relish, violent killing of humans in seeking acquisition of resources or property. At times this action is done in the very name of religion that condemns violence domestically. The Christian and Jewish Bible is replete with examples of believers willingly raping the land and it's people under command of God to do so. Such action is largely the same today - with each side calling on it's God or the same God to grant them victory. War heroes are often the subject of adoration for their population, while far less violent members of the society within are condemned to die for similar actions done within the population of the community. Again, base protection of the society microcosm.
Not to point up the Bible specifically, but this book is filled with mixed moral lessons. Within a few pages we can find disgust and anguish over David having sex with a married woman, and then find adulation and joyful bliss as the nation celebrates his having taken thousands of lives in battle. We find the Holy One of Israel incensed because a priest reaches out and holds the Holy Ark from falling, while that same God is willing to slaughter and order the slaughter of 'young men and old men and virgins and children' in imperialistic strikes to take land from those who have resided there for hundreds of years.
Now, many of us, find ourselves outside religion, but we might deal with complex emotions regarding our personal ethics. We question the origin of them, the purpose of them, and some have rejected them outright. It might be noted that 'morals' generally promote good effect, no matter the source to which they are fairly attributed. Community, religion, profession, family, personal experience all influence the shades of morals for us. They provide an order to our lives, no matter our views of the world in general. Most of us will retain much of what we were 'morally' though the reasons have changed. We may have thrown off the shackles of religion, but still feel a deep commitment to 'our standards'. Or perhaps some have moved into another religious community due to the strong influence toward morality that is there provided. For each it is a slightly [or greater] dynamic.
Isn't the mind a wonderful and mysterious thing?