John Gill's Exposition of the Whole Bible
Job 22:3
[Is it] any pleasure to the Almighty that thou art righteous?.... It is not; the Lord indeed takes pleasure in his people, not as sinners, but as righteous; and as they are considered such in Christ, he is well pleased for his righteousness' sake, and with it, being agreeable to his nature, will, and law; and with his people in Christ, in whom they are accepted, having imputed the righteousness of his Son unto them, and so they stand before him unblamable and irreprovable, and he takes pleasure in the work of his own hands upon them, called the good pleasure of his will, in the new man formed after his image in righteousness and true holiness, in the graces of his Spirit, and in the exercise of them, faith, hope, love, humility, fear of God, c. it is a pleasure to him to hear their prayers and praises, and to observe their ready and cheerful obedience to his will but then all this gives him no new pleasure, or adds anything to the complacency of his mind; he would have had as much delight and pleasure within himself, if there had never been an holy angel in heaven, or a righteous man on earth; he has no such pleasure in either as to be made more happy thereby, or so as to receive any "gain" or profit from it, as the next clause explains it. Some render it, "that thou justifiest thyself" k, or "that thou art just", or "seemest to be righteous to thyself" l; a self-righteous person is not pleasing to God; it is no pleasure to him when a man seeks for justification by his own works, or reckons them his righteousness; the publican that confessed his sin was rather justified with God than the Pharisee that applauded his own righteousness; such that are conceited of their own righteousness, and despise others, are an offence to God, a "smoke in his nose", Isaiah 65:5; for the righteousness of such is not real righteousness in the account of God, and according to his law; it has only the shadow and appearance of one, but is not truly so; and besides, to seek righteousness this way is going contrary to the revealed will of God, to the Gospel scheme of justification by faith in Christ's righteousness, without the works of the law, and is a setting aside his righteousness, and frustrating and making null and void the death of Christ, and therefore can never be pleasing in the sight of God:
or [is it] gain [to him] that thou makest thy ways perfect? no man's ways are perfect before God, even the best of men have detects in their works, and failings in their walk and conversations: some men's ways are indeed clean in their own eyes, and perfect in their own conceit; and if Eliphaz thought Job such an one, he was mistaken, see Job 9:20; there are others, who are in a sense unblamable in their walk and conversation; that is, are not guilty of any notorious crime, but exercise a conscience void of offence towards God and man, walk in all the commandments and ordinances of the Lord blameless; and yet this is no "gain" to God; for what does such a man give to him? or what does he receive of his hands? see Job 35:7. This was indeed Job's case and character.
k כי תצדק "quod justifices te", Junius Tremellius. l "Quum Justus es apud teipsum", Schmidt "quod tibi justus esse videris", Michaelis.