Clearly these are indications that they were written by Psychopaths.
No they were superstitious, ignorant Bronze Age goat herders, and when something terrible befell them...an epidemic, a famine, when they lost a big battle or were conquered....
.........or when Bathsheba’s new baby died of S.i.D.S., they just took their best guess at why....and their best guess was that they had somehow displeased their all powerful, malevolent God.