Since you ask a layered question,I will provide a multi-layered reply-
It is my stated belief that we are all sociopaths, with varied efficiency of function.
On the most shallow everyday level, most of us decide good/evil and right/wrong based on the mores fed to us by a cultural and societal milieu which evolved around the central theme of rewarding the selfless and punishing selfish behavior i.e what is good for the tribe and something that isn't? ie preserving the tribe, its power structure and hierarchical institutions. (aka law and order)
It is basically a mechanic of evolutionary behavior of providing the drive to expand and preserve the population of our species, coerced by the society into serving its own ends
But the fact remains that this mechanic has today, come to govern in general, actions which offer few tangible material rewards except maybe a more civil society and nicer strangers or doesn't entail great sacrifice on the individual's part.(Except maybe crime, but that again involves a degree of irrational behavior)
It is only when we raise the stakes and enter the variable of sentient intellect into the pathway of decision making and that we find that this mechanic is downgraded and becomes subservient to the "me- first" drive that sets the primary directives governing the course of an individuals life choices. I am not saying that this is the norm, but in my opinion a majority of human behavioral choices can be viewed as an interaction between selfless and selfish and long term gain v/s short term gain mechanics. This the hallowed ground of rational and irrational behavior and self-interest that the capitalists and economists love to talk about.
Interestingly humans can create multiple rationalizations and accept decision pathways favoring even the most selfless courses if it is in accord with their notion of greatest gain, even when the gain may be purely notional i.e social prestige or self esteem. Ah human unpredictability at its finest.
I will go deeper in subsequent posts....
P.S. Read Terry Pratchett's books, they provide a great insight into why atheism is so terrifying to most people.