Do social groups which do not form moral codes cohere or does the formation of social groups cause the formation of moral codes?
If it's the latter, it seems likely that bad moral codes being formed would result in dissolution of the social groups. It's almost like social groups might naturally form among conscious beings, and then just ass naturally be destroyed by the formation of faulty moral codes, with long lived social groups being prone to forming some form of stable moral codes that preserve themselves and pass on their moral codes....
but I'm just a memepeter.
There always seems to be a confusion between a moral code and personal ethos. A moral code, or common morality, is a group concept, and as such will be strict in some areas, vague in others, and silent in quite a few areas.
The reason for this is simple. Moral codes are created so people can cooperate to live in groups, and are tempered by the harshness of the environment.
Every moral code, whatever the culture or society is based on two basic rules. Do not kill your friends and do not steal your friend's stuff. That's it. After that, we argue about who is our friend and what is his stuff. In a place where life is harsh and resources are scarce, a moral code defines relationships and alliances, which allow cooperation for resources, instead of competition. This tells us who we can kill and from whom we can steal, and those we can't.
The great problem arises when life gets just a little easier than when we were fighting over who got to pick the apples. A moral code which made it perfectly acceptable to kill someone who stole from you, is good when the population is only couple of hundred people, will not work in a city of 50,000. At some point, personal moral judgments become a problem for the general order, and a new method, usually called "justice" is created to deal with dispute and offenses.
There is no such thing as a "faulty moral code". Every moral code which ever existed, dealt with the problems of the day. As the groups begin to mix, moral codes will conflict. What is permissible, or even mandatory, in one group, is forbidden in another. This is a conflict only the justice system can resolve.
Unlike the justice code, the moral code is always voluntary. It's more a set of expectations, than of rules. If someone steals from you, you may expect your neighbors to help you recover your property. They might not, but the moral code says they will approve, if you go and seize your property from the thief. You won't be a thief for doing so. The concept of ownership is the core of every moral code. What can and can't be owned is always well defined. In some cultures one can own other people, and these people have no property of their own. In some cultures, this is forbidden. It all comes down to who is in your group, and thus subject to the code.