Do good, O Lord, unto [those that be] good
That are made so by the Spirit and grace of God; for none are naturally good, but evil; only such who are regenerated and made new creatures, who have a good work of grace begun in them; who have the good Spirit of God, and his good graces, and the good word of God in them, and are filled with all goodness; and which is known by the good fruits which they bear, or the good works done by them. For these the psalmist prays the Lord would do good to them, not only in a providential way, as he does to all; but in a way of special grace, bestowing the blessings of his goodness on them, and causing all things to work for their good: and as saints should pray for one another, or supplication should be made for all saints, such a prayer as this may be the prayer of faith; for it is not to be doubted but God will do good to those he makes good. Aben Ezra says this may be considered either as a prayer or a prophecy; it may have respect unto the church in the latter day, and to the good things spoken of concerning it; which God will accomplish in due time, and should be prayed for; see ( Psalms 51:18 ) ;
and to [them that are] upright in their hearts;
which is a further description of good men, from the integrity and sincerity of their hearts; who do all they do before God and men, in the uprightness of their souls, cordially and sincerely, from right principles, and with right views.