I believe that a person can instinctively know when he has done something good and when he has done something bad.
The problem is some people can stop caring at some point wether they are doing right or wrong, and eventually they might as well not be able to tell one from the other.
Reviewing this, I think it's quite obvious that religion was very necessary in the humankind history.
If a (historical for the matter..) person wants to eat something and then suddenly sees someone else eating, he may well steal that other person food, he'll feel guilty about it the first time - I'm sure. But after several times he would just get used to it.
Although especially in historical times, even some people today don't understand the peril of hurting someone else. That's why a "Godly" figure is introduced and certain rules were laid. In other words, religion is actually the "law of the past". Ironically - religion itself caused (and still does) many wars and struggles between fanatics of them.
The reason that so many people became Atheists in the last century is that people reached the point of understanding as to what it costs to do evil. I believe humankind is always learning, we learned many hard lessons through all the wars and horrors of the past.
I think it's possible today for people to understand that when you betray your basic instincts as to what is right and wrong, eventually you or your later generations will always pay the price. And there is no set of rules, neither the bible or some constitution that can define what is to be truly a good person - only yourself you can find the way to become that, and I believe everyone have it in their veins, even when the situation is extremely complicated and it's hard to decide what to do - you can use your logic and instinicts, and eventually - even if you went wrong, you can take comfort in the fact that you tried to do the right thing, and that it was yet another lesson
