Professional competence was not sufficient to qualify a member of David"s staff for service. His courtiers also needed to maintain fellowship with God and walk in His ways. The king would not tolerate lying. Moreover, he would extend his requirements to all the people who lived in his kingdom. In his daily administration of justice he would cut off the wicked who practiced iniquity. "Cutting off" might be in execution, but it could also mean ending their present course of life by sentencing them to some other penalty. [source][source][source]
Why did David tolerate a wicked man such as Joab in view of this prayer? Obviously, David went back on this promise to God, both in his personal life, and in his choice of government leaders to some extent. Nevertheless, this commitment to holiness is an admirable model for all of God"s people. Perhaps David wrote this psalm early in his reign. [source][source][source]