The Just World Fallacy Theory was developed by Melvin J. Lerner and his colleagues in the early 1960s. The theory was developed at the time when Social Psychology was an emerging discipline, and psychologists were probing social and systemic influences on behaviour.
Social psychology dates back to the late nineteenth century, but it didn’t really take off as a major area of psychology until after World War II. The reason for that is simple—the Holocaust. At least in the US, the standard psychological paradigm at the time was behavioralism, an approach that favoured studying innate personalities and personality disorders. (This was before the cognitive revolution that occurred after World War II as well. So the brain wasn’t yet being studied to the extent it is today. Also, it’s worth noting that behaviourism was not popular in Europe.)
The Holocaust specifically, and the massive civilian death tolls of World War II in general, caused a crisis in numerous disciplines. Western philosophy could not explain these horrific events, so existentialism became popular for the first time. The two most famous existentialists, Camus and Sartre, formulated their philosophies primarily because of World War II. In psychology, at least in the United States, the crisis was pretty simple. If people are born with innate personalities and these personalities dictate their future behaviour, how can we explain concentration camps? The guards and the prisoners would have appeared to have had “normal” personalities prior to the Holocaust, had they been studied. This certainly wasn’t the only motivating factor of social psychologists postwar, but it was a major one.
The Just World Fallacy Theory emerged as part of this increased interest in explaining how seemingly good people could do awful and evil things.