The wicked shall be a ransom for the righteous, and the unfaithful for the upright. (Proverbs 21:18)
To bring justice to the wicked and the unfaithful will deliver a land of sin and crime. Consider the punishment of Achan for the deliverance of Israel. "Did not Achan the son of Zerah commit a trespass in the accursed thing, and wrath fell on all the congregation of Israel? And that man did not perish alone in his iniquity." Here is a prime example of the wicked and unfaithful being a ransom for the righteous and the upright. When a nation allows violators of the laws of the land to go unpunished, that nation will be held responsible for those iniquities. When criminals, murderers and the like are not held responsible for their crimes and actions, God in turn will hold those responsible who allow them to go free. However, when a nation or peoples hold those responsible for their felonies, those transgressors become a ransom for the people and justice is satisfied.