Pro 21:2 Every way of a man is right in his own eyes: but the LORD pondereth the hearts.
Pro 21:3 To do justice and judgment is more acceptable to the LORD than sacrifice.
Again Gill writes..
To do justice and judgment,…. The moral duties of religion, what is holy, just, and good, which the law requires; what is agreeably to both tables, piety towards God, and justice to men; that which is just and right between man and man; which, especially if done from right principles and with right views,
is more acceptable to the Lord than sacrifice; not than any sacrifice; than the sacrifice of a broken heart, or the sacrifice of praise and thanksgiving, or of acts of goodness and beneficence, or of a man’s whole self to the Lord; but than ceremonial sacrifices; which, though of divine institution, and typical of Christ, and when offered up in the faith of him, were acceptable to God, while in force; yet not when done without faith and in hypocrisy, and especially when done to cover and countenance immoral actions; and, even when compared with moral duties, the latter were preferable to them; see 1Sa 15:22.
Of Good Works
1. Good works are only such as God hath commanded in his holy Word, and not such as, without the warrant thereof, are devised by men, out of blind zeal, or upon any pretense of good intention.
2. These good works, done in obedience to God’s commandments, are the fruits and evidences of a true and lively faith: and by them believers manifest their thankfulness, strengthen their assurance, edify their brethren, adorn the profession of the gospel, stop the mouths of the adversaries, and glorify God, whose workmanship they are, created in Christ Jesus thereunto, that, having their fruit unto holiness, they may have the end, eternal life.
3. Their ability to do good works is not at all of themselves, but wholly from the Spirit of Christ. And that they may be enabled thereunto, beside the graces they have already received, there is required an actual influence of the same Holy Spirit, to work in them to will, and to do, of his good pleasure: yet are they not hereupon to grow negligent, as if they were not bound to perform any duty unless upon a special motion of the Spirit; but they ought to be diligent in stirring up the grace of God that is in them.
4. They who, in their obedience, attain to the greatest height which is possible in this life, are so far from being able to supererogate, and to do more than God requires, as that they fall short of much which in duty they are bound to do.
5. We cannot by our best works merit pardon of sin, or eternal life at the hand of God, by reason of the great disproportion that is between them and the glory to come; and the infinite distance that is between us and God, whom, by them, we can neither profit, nor satisfy for the debt of our former sins, but when we have done all we can, we have done but our duty, and are unprofitable servants: and because, as they are good, they proceed from his Spirit; and as they are wrought by us, they are defiled, and mixed with so much weakness and imperfection, that they cannot endure the severity of God’s judgment.
6. Notwithstanding, the persons of believers being accepted through Christ, their good works also are accepted in him; not as though they were in this life wholly unblamable and unreprovable in God’s sight; but that he, looking upon them in his Son, is pleased to accept and reward that which is sincere, although accompanied with many weaknesses and imperfections.
7. Works done by unregenerate men, although for the matter of them they may be things which God commands; and of good use both to themselves and others: yet, because they proceed not from an heart purified by faith; nor are done in a right manner, according to the Word; nor to a right end, the glory of God, they are therefore sinful, and cannot please God, or make a man meet to receive grace from God: and yet, their neglect of them is more sinful and displeasing unto God.