2Sa 23:6 But worthless men are all like thorns that are thrown away, for they cannot be taken with the hand
This passage is said to be the last words of David. He speaks as a leader with wisdom having worked with men. He knows what it means to serve faithfully under governing authority and recognizing the qualities that distinguish some from others. To him worthless (wicked) men are like thorns. Thorns cause nothing but pain and cannot be trusted, and must be handled with care.
David at one point left with 600 warriors to rescue their families. On the way, 200 became weary and remained behind. David continued with 400 and had great victory, they recovered all and then some. On their way back, the 400 resolved to only restore to the families and the belongings of the 200 but not the additional spoils of their enemies. David called the 400 wicked and worthless men (1Sam 30:22). These men were greedy, lacked empathy, were boastfully in the time they should have been unified.
Those who are worthless, not serving well are harmful to a commonwealth. Instead of being the joy and comfort of their subjects, they give pain and trouble, and cause grief and sorrow. They delight in putting hardships upon their brethren, and care not who is starved as long as they are full. Distance from such, why? Vs 7, a person who meddles with thorns can expect to be hurt.