When God gave the Ten Commandments, "He added no more" (Deuteronomy 5:22 Deuteronomy 5:22These words the LORD spoke to all your assembly in the mount out of the middle of the fire, of the cloud, and of the thick darkness, with a great voice: and he added no more. And he wrote them in two tables of stone, and delivered them to me.
American King James Version×). It was a complete spiritual law. Still, God knew that for a physical nation, there would have to be a civil administration with much more detail about what constituted crime and what judgments to execute against specific violations. He had already given capital punishment in Noah's day. It is not known if He had related any other judgments at that time, although it seems likely that He would have. Frankly, judgments were needed because God knew people would not remain chaste and law abiding (see Exodus 22:16 Exodus 22:16And if a man entice a maid that is not betrothed, and lie with her, he shall surely endow her to be his wife.
American King James Version×). He knew that they would take advantage of others wrongly (22:25) -- and He provided for these eventualities. The judgments exist because of human failings. Penalties would not be needed if people always obeyed. But they don't - and this could wreak havoc in a national setting. So besides the tablets of the Ten Commandments, God here gives Moses the judgments. These judgments were based on God's law of love and pertained to relationships between the people.
God allowed slavery, but in a much different way than one may perceive today. An Israelite may have become a slave due to poverty, debt, or crime. After six years of servitude, God commanded that he be given freedom and help to reestablish himself so as to better avoid getting in the same situation again (Deuteronomy 15:12-15 Deuteronomy 15:12-15  And if your brother, an Hebrew man, or an Hebrew woman, be sold to you, and serve you six years; then in the seventh year you shall let him go free from you.
 And when you send him out free from you, you shall not let him go away empty:
 You shall furnish him liberally out of your flock, and out of your floor, and out of your wine press: of that with which the LORD your God has blessed you you shall give to him.
 And you shall remember that you were a slave in the land of Egypt, and the LORD your God redeemed you: therefore I command you this thing to day.
American King James Version×). Israelite slavery was similar to a state of indentured servitude. The purpose was not intended to be heavily punitive. The intention was to enable a person to make a new start and help him succeed in life. God also gave laws regulating the treatment of slaves. In fact, it was expected that some would be treated so well that they would want to stay with their masters even after the time came for them to be set free (verses 16-18).
It was a capital crime to curse or hit one's parents. This judgment was based on the Fifth Commandment, "Honor your father and mother." While the punishment may seem cruel and unusual to our 21st-century minds, its intent was that Israel not raise a nation of rebellious children, as we see so frequently today in our supposedly enlightened societies. This law, like many others, acted as a safeguard for society as a whole. If a rebellious child showed so little respect for authority that he would lash out and strike his own mother or father, there would be little to prevent him from striking out and injuring or killing others. Thus this law helped remove those who scorned authority and lacked the will or desire for self-control before they became too great a threat to innocent people around them. When this law was enforced, society as a whole was kept safe from young, out-of-control thugs who had chosen to live in a way that made them a danger to everyone else.
The words "eye for eye, tooth for tooth" were not intended to encourage vengeful feelings. Nor were they to be taken literally (although "life for life" and "stripe for stripe" could be literal). The principle was that the punishment should fit the crime and not go beyond it. On occasion, capital punishment had to be imposed. But in other cases, we read that there were various ways the guilty party could be redeemed.
God's laws are not given as a burden to His people. On the contrary, they are imposed to prevent problems from occurring. All people shared a responsibility in both preventing and solving problems. We will be reading much more about God's laws, comprising commandments, statutes, judgments and ordinances. God revealed them to define what He means by love. Love is the fulfilling of the law (Romans 13:10 Romans 13:10Love works no ill to his neighbor: therefore love is the fulfilling of the law.
American King James Version×).