When morality is based upon spiritual/religious values that morality is inflexible. Whatever sacred text or adopted doctrine deems to be moral/immoral is the final word, the ultimate authority. This has been ‘the way it was’ for thousands of years in a majority of cultures.
Included in these moral codes are things other cultures might consider silly, petty and occasionally, downright offensive. The complete covering of the female form, letting perfectly edible cattle roam the streets, stepping around insects, waving pots of incense… one culture’s rituals/moral code often seems irrational and unnecessary to another.
As these sacred codes are handed down over hundreds of generations, the original significance is often lost to history. They are practiced as rote tradition, without question or examination for relevance in a growing and more technically advanced global society.
Without a strict spiritual/religion-based moral code, society can flex, sway, and adapt to situations based on a knowledge of things tried in the past, and discard the useless relics of a bygone era, keeping intact only those moral codes that actually work for society’s good.
This, of course, flies in the face of most religion’s beliefs that morals are fixed, unchangeable and immutable.
This is the battle we now see in the U.S. on several fronts. Gay marriage, Don’t-ask- don’t-tell, abortion, casinos, liquor laws, etc. Often these battles break down over the core fight as to whether or not morality is relative. Religious doctrine vs. secular reasoning.
The non-religious tend to believe that we as a species learned morals codes by trial and error.
Those codes that enhanced the chances of a growing, thriving culture were passed down from generation to generation. Not because they were uttered by a burning shrub, but simply because those societies that had the more successful model also happened to produce more offspring. Those tribes that did not have codes of cooperation split up or killed each other off before a lot of reproducing occurred. Social evolution.
Here and now nearly all cultures have many similar codes, most enacted into enforceable laws.
Killing, theft, lying, etc. are nearly universally shunned. More minor codes dealing with the political status of certain genders or races, ownership of property, division of wealth are still being worked out.
Many religions, especially the more Orthodox ones rooted in the bronze age, still struggle to maintain an archaic, almost quaint set of customs and rules that externally appear terribly dated and far past their meaningfulness.
Any moral code that fails to factor in rising literacy rates, global interaction, democracies, and the equality of all people is doomed to eventually fail. Social evolution is not perfect, but at least it can rise and fall on its own merit, not just because someone thousands of years ago proclaimed it to be the end-all, be-all.