My problem with many religions is that I don't believe "because I said so," "because I am your mother," or "because god said so" are arguments that actually do much to reinforce sound morals. They may teach people to not break the rules when they think someone is watching, but as you said when they think they can get away with it all bets are off. Now if instead of a set of rules that can be bent and broken you instill a sense of identification and commonality with fellow man then you will end up with a much stronger moral base. I don't feel that this requires religion, but some sense of spirituality may be useful.