Thinking like this is a way of trying to hold on to a belief in God’s justice. If something in the world seems ‘unfair’, but if you believe in a God who is both all-powerful, all-loving and all-fair, one way of getting round the problem is to say that it only seems ‘unfair’, but actually isn’t. There was after all some secret sin being punished. This is a comfortable sort of thing to believe if you happen to be well-off, well fed and healthy in body and mind. (In other words, if nobody can accuse you of some secret previous sin.)