In every religion there seems to be a version of the golden rule: do unto others as you would have them do unto you. They may have thousands of other rules, but the all of the ones that make sense seem to have been derived from the golden rule, while the rest can arguably be ignored. Almost all children understand right and wrong from a very early age, and because morality is essentially very simple, they don't need to live in religious families to gain this knowledge. Even so, a child who understands right and wrong will not necessarily behave well: a great deal depends on how well that child is treated by others, because a child who grows up on the receiving end of a great deal of violence is likely to want to have his turn as the one dishing it out. Most (if not all) of the world's mass-murdering dictators grew up being violently abused by the people around them, as did the ten-year-old boys who killed a two-year-old boy in England a few years ago. They could tell right from wrong, but it meant nothing to them because they simply didn't believe that anyone else bothered to follow the rules.
indentOne of the main issues for philosophers is how to define morality precisely so that it can be used to govern the behaviour of intelligent machines when they begin to run and police the world. The golden rule in its standard form would allow a crazy person to kill other people if he was be quite happy about the idea of being killed for no good reason himself. A better form of the rule would therefore be: never do anything to anyone that they wouldn't want to be done to them. While this is better, again it not quite right because it looks as if it wouldn't allow you to punish criminals. The rule also fails to explain how you should treat animals. It is actually possible to make the rule work if you add a long string of conditions to it, but it turns out that there is a much simpler version of the golden rule underlying the whole thing: always do your best to minimise harm. This rule does need a little bit extra added to it to prevent artificial intelligences deciding that the best way to minimise harm is to wipe out all living things humanely, but once that is taken into account, the rule then appears to be complete.
indentThe other issues concerning morality revolve around deriving a sensible system of universal laws from the golden rule. This is necessary because it often takes a lot of time and effort to work out the exact form a derived rule should take. It can also be necessary to have laws to prevent people from doing things which are moral just in case they have made a mistake in their judgement and are actually unwittingly doing something wrong. This is why it is usually illegal to kill people, even though it may be perfectly moral to kill someone who you know to be extremely dangerous. I intend to write more about this here later...