Just World Theory is a core reason as to why theists believe in God. It is this desire for balance and fairness which is psychologically ingrained into us, no matter what ancillary beliefs we have. As a result, we see the world, the universe, as a thing which must be, on balance, fair.
As Wikipedia states:
The just-world hypothesis or just-world fallacy is the cognitive bias (or assumption) that a person’s actions are inherently inclined to bring morally fair and fitting consequences to that person, to the end of all noble actions being eventually rewarded and all evil actions eventually punished. In other words, the just-world hypothesis is the tendency to attribute consequences to—or expect consequences as the result of—a universal force that restores moral balance. This belief generally implies that in the existence of cosmic justice, destiny, divine providence, desert, stability, or order, and has high potential to result in fallacy, especially when used to rationalize people’s misfortune on the grounds that they “deserve” it.
The hypothesis popularly appears in the English language in various figures of speech that imply guaranteed negative reprisal, such as: “You got what was coming to you“, “What goes around comes around“, “chickens come home to roost“, and “You reap what you sow“. This hypothesis has been widely studied by social psychologists since Melvin J. Lerner conducted seminal work on the belief in a just world in the early 1960s. Research has continued since then, examining the predictive capacity of the hypothesis in various situations and across cultures, and clarifying and expanding the theoretical understandings of just-world beliefs.
There are, understandably, correlates between the basic psychological bias an religiosity. [note 1 and 2]
Only the other day our twins were playing on a stool with wheelie casters on our tiled kitchen floor, whizzing up and down to much happy laughter.
However, we have a large range oven cooker inherited from the previous owners of our new house. It looks a bit like this:
But not such a swanky kitchen… Anyway, one of the twin 4-year-olds (this is still open to debate) was responsible for the wheelie chair with twin rider flying at top speed into the left-hand over door.
Door utterly smashed. A couple of seconds’ stupidity, and we have a…
You see, the oven is 10 years old and they don’t make the parts for that model, so we would have to get a new one.
Thank the cosmos for Google and the ability to search by part number, as I managed to get the last oven door I could find from a spares company. So the bill was down to a mere £150 (*still sobbing).
My partner and I were sitting down talking about this after shouting the boys up to bed (yes, I know under determinism such anger is pointless. Yes, yes, yes…psychology). She uttered the words, “The only way I can see it is that it had to happen because the oven was faulty and was going to burn the house down anyway…”
She actually gave a couple of reasons why this might have happened. Now, though she used to be (socially?) Catholic before we were together, and by osmosis, living with me, lost her faith, she is not alone in holding such views. They are extraordinarily commonplace no matter whether you hold faith or not. The idea of this karmic scenario just seems fairer, and we struggle to cope with things not being fair. It’s why we like happy endings to films, and just desserts. So when things go wrong, there must be a reason for it.
But on naturalist atheism, of course, the universe does not work like this. Shit happens. Period. So it is not surprising that an inherent desire for and belief in a just world can lead to, or is a core value in, religiosity and belief.
In fact, the Jews took on the Greek idea of a soul, heaven and hell precisely on account of bad things happening to good people (the Chosen People, the Jews) under the Hellenistic rulers of the Seleucid Empire. One wonders why these core concepts of eternal life, bad being balanced in the afterlife, heaven and hell, did not appear at all in any meaningful way in the Old Testament, but evolved in the inter-Testamental period.
To conclude: watch out for that Just World fallacy popping into your daily appraisal of life and the universe.
Shit certainly does just happen.
 – Begue, L. (2002). Beliefs in justice and faith in people: just world, religiosity and interpersonal trust. Personality and Individual Differences, 32(3), 375–382.
 – Kurst, J., Bjorck, J., & Tan, S. (2000). Causal attributions for uncontrollable negative events. Journal of Psychology and Christianity, 19, 47–60.