That thou mayest walk in the way of good men, and keep the paths of the righteous.
 For the upright shall dwell in the land, and the perfect shall remain in it.
 But the wicked shall be cut off from the earth, and the transgressors shall be rooted out of it.
We avoid the wrong associations so we can be connected to the right ones. We avoid the wrong path so that we can walk on the right one. We avoid becoming the wrong version of ourselves so we can become all that GOD wants us to be.
See this version.
NLT So follow the steps of the good, and stay on the paths of the righteous. For only the godly will live in the land, and those with integrity will remain in it. But the wicked will be removed from the land, and the treacherous will be uprooted.
For every time you face a contention over what is rightfully yours, declare v21 and v22 over the situation. And recover what is yours. You will not lose your possession to the wicked in Jesus precious name!!!
And if you have ever been cheated or exploited, may the LORD, the righteous Judge, give you double recompense speedily!!
CEV Follow the example of good people and live an honest life. If you are honest and innocent, you will keep your land; if you do wrong and can never be trusted, you will be rooted out.
As you go on in life, always ensure you keep yourself in a position where GOD can defend you.