A version morality that is based wholly on the teachings of a religion is normally just a ”It just is so and you don't need to know why” -answer to moral dilemmas. It is a shortcut for saying: ”You just don't need to worry about these things, as we have it all sorted out for you”.
Everything is nice and dandy as long as a religion really does offer meaningful and usable answers for people who face moral dilemmas in their lives. A major problem, however, is that the moral codes of all major modern religions were born in quite different ancient societies. The ancient and frozen answers to moral dilemmas that they still do offer in extremely different modern societies are very often simply outdated and all too often even simply wrong.

For example, 2000 years ago overpopulation were not seen as a problem as there was no means to control it anyhow. Now, overpopulation is a major problem threatening the whole future of humanity. This is true, even if we have the means to keep it in check, if only some of the most widespread religious moral codes would allow using these means to control populations.
Some religions have responded to this tremendous change in societies better than others even in this respect. For example, the modern Western Christian Protestant state churches of Europe are top pupils in this respect. However, Catholicism and Islam are the real problem cases.

The basic problem is that things that are seen as good and bad in different societies are not absolute truths. This happens, even if religions like to claim some kind of absolute 'divine' source for their ideas concerning morality. The sad truth is that they are just old human ideas, even if people might have learned them from a source they trust to be of supernatural origin.
Of course, the idea of good and bad is present in all of the decisions that we make. Every human being has in his mind an inbuilt device for asserting bad and god thanks to the social evolution of human species. Most people normally also act according to it.
There really is strong evidence that we all human beings share this inborn evolutionary sense of justice. Sometimes of course these devices are corrupt or missing altogether from the minds of criminal or mentally ill people (like psychopaths and sociopaths). However, all normal people seem to have this moral faculty.

Paul Cézanne, Quarry Bibémus 1898-1900, Museum Folkwang, Essen, Germany - Wikipedia

The problem is that there still are endless variations on how this inner device works. Culture, inherited traits, social pressures and personal history can make different people see different things as good or bad. This is the basic reason why we have commonly agreed laws in all developed societies. A successful society just needs commonly agreed rules on what is seen as bad and what as good behavior in a society.
Religions were born as an tool for creating moral stability in ancient unstable societies. Remembering this, one needs to remember that the monks and priests who did burn old ladies in medieval Europe thought that they were acting in an extremely moral fashion.

We know now that they were wrong, but they represented the absolute moral high ground of their day in their culture. The thousands of priests and monks involved in burning witches generation after generation were not personally mostly bad or insane people at all.
They were led to believe that there is a source of objective morality. The believed that this source is outside the reach of humanity and cannot be changed or challenged by mortal men. They were just implementing this divine moral vision. This process just can well lead to insane implementations also. A sad fact is that it happens all too easily when people see themselves just implementing a higher "objective morality" that is out of their reach and cannot be questioned at all.

All societies all over the world have very similar sets of moral rules. The inner sense of justice that is grown out of the needs social life of an extremely social animal is one factor. The other is that any larger human group just needs a certain set of very similar rules of conduct to flourish. After all, humans in all societies have very similar basic needs.
However, the practical implementation of the shared basic common human vision of right and wrong is always and inevitably culture-dependent. Besides, it has always been that way. Anything like "absolute morality" just does not exist and has never really existed.

The culture-dependent nature of morality is not a problem, but a solution to the problem of how to create moral rules that suit different kinds of societies in very different stages of development and needs. For example, just the widening gap between the Catholic morality frozen in time and the reality fast changing world around it was a major cause for the Reformation. There simply was a direct need to mold the moral code in society to represent the reality better.

However, the inevitable cultural relativity of morality becomes a pressing problem in situations where members of cultures with very different views on morality live mixed in the same society for extended periods of time. For example, the Islamic honor-based culture of morality does very often become a problem when it is used in societies that have long ago abandoned this very ancient model of morality. Life becomes easier if people in a society do share a similar vision of basic morality also.
A clash of cultures is an inevitable result of trying to enforce two very different basic ideas of morality at the same time in the same society. We have already seen these culture-wars during the last decades, but clashes do become more and more dangerous when differences grow.

We can judge different versions of morality on their usability and the good they do produce for the society in practice, as morality is in the end a tool for producing and maintaining good and healthy societies. Different visions of morality can be objectively judged only by the practical benefits they do produce also for the individual. However, they most of all benefit or harm the society, because morality is a social tool. A person living totally alone does not need morality.
One should also remember that morality is at very basic level based on the willingness of the people to accept the common social rules that, in fact, do make living in large human groups possible. Some kind of morality just has to be there. Social life would simply become impossible without the predictability of action that only commonly shared basic moral codes can produce.

PS. There are of course people like Sam Harris who think that science can ultimately give objective criteria also for morality. However, true universal objective morality is a pipe dream in most moral issues, I'm afraid.

(This piece was completely refreshed on 14th of October, 2012)