As far as I can see, the story of Job centres on Job being righteous. There is no indication at all that Job suffered as a result of sin, or personal quirks, or a thousand different other things.
God said he was a righteous man; Satan said that he bet that he could change that, and God said fine.
He was tested, and found to be righteous. He was righteous in his own eyes. He was righteous in God's eyes. In fact, in the eyes of the one who would have known him the best, his wife, it can be inferred that she believed that he was righteous, and it was God that was not righteous "Curse God and die", therefore.
There are many still that walk away from reading Job with that impression. The whole idea of allowing every kind of evil befall Job, not as a result of justice, but in order to win a bet with the Satan, many find troublesome.
Otherwise, it could always be said that he suffered on account of his sins, and that is what would have been the case if Job was in any way not righteous.
As it was he was not unrighteous; he was simply wrong. The worldview that he shared with his wife, and his friends, and the whole of ancient society, was wrong. People are not born into poverty and suffering due to the fact that they deserve to be there. People are not born into the lap of luxury on account of their perfection and their merit to have all that.
Like Abraham taking Isaac up the mountain to slaughter the son of promise, it doesn't make sense to have faith in God and believe that God is good and author of justice, and yet would order the world in the way that he does.
And yet, even as it does not make sense, Abraham and now Job placed their trust in God anyway, that he is just and all knowing and it is human limitation that is deficient for understanding of the profound mystery of suffering.
We put dogs down when they reach a level of suffering where it makes sense. It is unfair that we allow them to go on in pain when all rational hope of something better is gone. People today make the same rational choice about their own lives, where it makes better sense to say enough and just go die, as Job's wife advocated. That is to say that it really is God's fault that we suffer, because creation itself is imperfect, and death is the corrective.
It takes absolute faith to carry on through the intense pain and suffering, without seeing any reason for it, except to believe that God does not make mistakes, and that a human life is worth much much more than the pain involved in carrying on.