But imagine you live 3500 years ago in the Middle East, where roving bands of armed men couldn't wait to relieve you of everything you had (including your life) and the balance of civilization teetered between a centralized monarchy that brutally enforced oppressive taxes (even in Israel... I Sam 8:11ff) and a frontier-style Wild West (Wild East?) showdown at any moment (Jdg 21:25).
"They shall therefore keep my charge, lest they bear sin for it and die thereby when they profane it: I am the LORD who sanctifies them." (Lev 22:9)
Human laws are defined as good to the degree to which they adhere to God's universal standard of righteousness. And the vast majority of civilizations do correspond in many ways to God's moral law (in punishing theft, murder, etc.). The primary purpose of the God's law, both spiritually and temporally, is to save your life. We, as a race, are a wicked people that are continually looking for new ways to dig our own grave, and so the law works as a powerful common grace (for believers and unbelievers) to show us the holiness and justice of God, and restrain us from heaping up more judgment.
The best known (and most important) aspect of the God's law is the spiritual, by which God convicts us of our sin and our need for a Saviour. But the more obscure side is God's gracious use of law here and now: it's considered barbaric and cruel now, but the prospect of a horrible punishment waiting when one commits a vile crime actually does deter people from following through with our evil intentions...
"And all Israel shall hear and fear and never again do any such wickedness as this among you." (Deut 13:11)
"And all the people shall hear and fear and not act presumptuously again." (Deut 17:13)Think of all the trouble you would have gotten into if your parents hadn't told you: "You'd better not or else!" The law (both God's universal moral law and each country's civil law) is an unappreciated common grace, restraining the effects of sin and making the world a better place.