Job has been carried away by self-righteousness, and this had fed his complaints. This is the trap he had fallen into.
Job has been saying that God is unfair and therefore implicitly that he is more just than God: ‘My sense of judgement is greater than God’s.’ That is blasphemous. He has been carried away by his own sense of grievance. Never do believers put themselves in a position where they investigate the justice or fairness of God. Any sense we have of what is right comes from God. When we come to consider some doctrine, always we assume God is fair. If we are struggling with some doctrine or some providence, we assume that it is because our values are in some way distorted. Job has a sense of grievance. This will make us lose communion. If we experience grievance at his dealings, we set ourselves up to judge him. Under his terrible suffering, Job was so depressed and full of self-pity that he wouldn’t see the value of his forgiveness, the value of being a child of God. We must always comfort ourselves with our privileges. Job had got so down that he wondered what was the value of being a child of God. We must never let ourselves get into that position. I have understanding which no worldling has; all things work together for my good.
It has been said that it was unfair of Elihu to charge Job with this because Job had explicitly disclaimed such an inference. He had raised this possible conclusion as one which the wicked might reach (Job 21:15), but had immediately rejected it as unworthy. It is not a fair way of disputing to charge men with those consequences of their opinions which they expressly renounce. However, a man may well deny a consequence of his argument which he judges to be unattractive while still holding a view that cannot help but lead to that conclusion. Job saw the great evil of this claim in others, and yet he was guilty of the same attitude himself but in a way that was not immediately obvious. Though he had not seen the connection as Elihu had, he was guilty of claiming to be more righteous than God because he said that God was remiss in ignoring and failing to reward his righteousness.