It could be observed that Job is combatting a simplistic, childish, overly-literalistic interpretation of Deuteronomy, not Deuteronomy itself. And not of Deuteronomy alone, but of much of the rest of the Bible, Proverbs to be included. It simply demonstrates the tension that exists in real life, the same thing we teach our children…
On the one hand, we try to teach them basic principles. Work hard and you’ll be rewarded and recognized. Take care of yourself, physically, eat right and exercise, it will benefit you with good health, etc., be wise with finances, save appropriately, and you’ll be financially secure. All those are true principles, and we’d be derelict if we didn’t teach them to our children.
But it is also reality that despite our own best efforts, our hard work might result in someone’s jealousy and false accusation. Our best efforts at health and an unexpected cancer will still strike. Our best financial practices and an unexpected accident can still bankrupt us.
Which is true? Clearly, they both are. Deuteronomy (and Proverbs, and lots of other teachings, including some from Jesus himself) communicate those basic principles of blessing following obedience and curses following disobedience. This is a true and right principle, and ought to be taught and embraced as true.
On the other hand, we know that real life happens in God’s providence, and thus we can’t simplistically equate one individual’s suffering with a curse due to their disobedience.
For instance, Jesus promised “there is no one who has left house or wife or brothers or parents or children, for the sake of the kingdom of God, who will not receive many times more in this time”.
At the same time, he recognized that “Do you think that these Galileans were worse sinners than all the other Galileans, because they suffered in this way? No, I tell you; but unless you repent, you will all likewise perish.
Deuteronomy and Job only “contradict” each other if we’re willing to say Jesus contradicted himself. But I think it far more reasonable that it is ”both/and” in both cases: the larger principle of blessings for obedience is true in general, and it is also true that we can’t extrapolate this in some kind of 1-to-1 ratio so as to determine that if someone is suffering, it can only be due to their disobedience.