The arrogant have dug pits for me, Men who are not in accord with Your law.
NASB95
The insolent have dug pitfalls for me; they do not live according to your law.
ESV
The proud have digged pits for me, which are not after thy law.
KJV

Though a steady confidence in severe and protracted exercise may enable us, not to forget the statutes; yet we shall hasten to carry our complaint before Him. How many are the days of Your servant?—my days of affliction under the "fury of the oppressor." To complain of God is dishonorable unbelief. To complain to God is the mark of His "elect, which cry day and night unto Him, though He bears long with them." Christians! study this instructive pattern; and, when exposed to the lawless devices of the proud, do not forget your hiding-place. God in Christ is your stronghold, "whereunto you may continually resort. He has given commandment to save you." Your trial has done its appointed work, when it has brought you to Him; and inclined you, after your blessed Master's example, instead of taking the vengeance into your own hands, to commit yourself and your cause "to Him that judges righteously." 'And this,' as Archbishop Leighton excellently observes, 'is the true method of Christian patience—that which quiets the mind, and keeps it from the boiling tumultuous thoughts of revenge; to turn the whole matter into God's hands; to resign it over to Him, to prosecute when and as He thinks good. Not as the most, who had rather, if they had power, do for themselves, and be their own avengers: and, because they have not power, do offer up such bitter curses and prayers for revenge unto God, as are most hateful to Him, and differ wholly from this calm and holy way of committing matters to His judgments. The common way of referring things to God is indeed impious and dishonorable to Him, being really no other than calling Him to be a servant and executioner of our passion. We ordinarily mistake His justice, and judge of it according to our own precipitate and distempered minds. If wicked men be not crossed in their designs, and their wickedness evidently crushed, just when we would have it, we are ready to give up the matter as desperate; or at least to abate of those confident and reverent thoughts of Divine justice which we owe Him. However things go, this ought to be fixed in our hearts, that He who sits in heaven judges righteously, and executes that His righteous judgment in the fittest season.'

Usually the Psalmist is expressing his love for the law. Here he is complaining against his enemies; yet still implying the same spirit, that the pits, which the proud dug for him, were not after God's law. The martyr's cry under the altar shows the acceptance of this complaint; "seeing it is a righteous thing with God to recompense tribulation to them that trouble" His people, "and to them that are troubled rest." Some of us indeed have known but little of "cruel mockings" and bitter persecutions. Let such be thankful for the merciful exemption from this "hardness:" but let them gird on their armor for the conflict. Let none of us, in the determination to "live godly in Christ Jesus," expect to escape "persecution." Let us "count the cost" of suffering for Christ, whether we shall be able to abide it. For the mere spiritless notions, or for the unenlivened forms of religion, of which we have never felt the power, nor tasted the sweetness, it would be little worth our while to expose ourselves to inconvenience. But if we understand the grand substantials of the gospel—if we are clearly assured of their reality, practically acknowledge their influence, and experimentally realize their enjoyment, we shall dare the persecuting malice of the proud in defense of a treasure dearer to us than life itself. Should we, however, be too rich to part with all for Christ, or too high in the estimation of the world to confess His despised followers, it will be no marvel, or rather a marvel of mercy, if He should sweep away our riches, and suffer the proud to dig pits for us. To make this world "a wilderness or a land of darkness" to us, may be His wisely-ordained means to turn us back to Himself as our portion, to His word as our support, to His people as our choice companions, and to heaven as our eternal rest.

As men who hunt wild beasts are accustomed to make pitfalls and snares, so did David's foes endeavor to entrap him. They went laboriously and cunningly to work to ruin him, "they dug pits"; not one, but many. If one would not take him, perhaps another would, and so they dug again and again. One would think that such haughty people would not have soiled their fingers with digging; but they swallowed their pride in hopes of swallowing their victim. Whereas they ought to have been ashamed of such baseness, they were conscious of no shame, but, on the contrary, were proud of their cleverness; proud of setting a trap for a godly man. "Which are not after your law." Neither the men nor their pits were according to the divine law: they were cruel and crafty deceivers, and their pits were contrary to the Levitical law, and contrary to the command which bids us love our neighbor. If men would keep to the statutes of the Lord, they would lift the fallen out of the pit, or fill up the pit so that none might stumble into it; but they would never spend a moment in working injury to others. When, however, they become proud, they are sure to despise others; and for this reason they seek to circumvent them, that they may afterwards hold them up to ridicule.

It was well for David that his enemies were God's enemies, and that their attacks upon him had no sanction from the Lord. It was also much to his gain that he was not ignorant of their devices, for he was thus put upon his guard, and led to watch his ways lest he should fall into their pits. While he kept to the law of the Lord he was safe, though even then it was an uncomfortable thing to have his path made dangerous by the craft of wanton malice.