Dueteronomy literally means “second law”.
The Book of Dueteronomy is a series of three speeches given by Moses on the Plains of Moab just before the Hebrews crossed the Jordan River into the promised land after being led out of Egypt and wandering the desert for 40 years. Moses was to die before they crossed over and these are his three farewell addresses.
The context in which Dueteronomy (and Leviticus) must be read is the Book of Exodus and the Book of Genesis. One cannot read Dueteronomy with understanding unless they have read and understand Exodus and Genesis first.
The Hebrews had been led out of slavery in Egypt where they had forgotten how to worship God. The first generation, people who had seen God’s works first hand, abandoned the covenant after only three days by worshiping a metal statue. The second generation, the people to whom Moses spoke, were taught how to rely on God by being led through the wilderness for 40 years. They were about to enter the land promised to them by God in the covenant with Abraham. Moses was teaching them how to worship God, how to rely on God and how to be different, better than the nations around them and better than the Egyptians who held them in slavery without any hope.
Dueteronomy has to be read in this context - a world gone completely haywire where the people around the Hebrews engaged in homosexual gang rapes, prostituted their daughters, drank human blood and burned their children alive as sacrifice to false gods. God’s laws are the first controls on an out of control situation as he teaches his children not to act like those around them, to utterly abhor such behavior and purge it from their midst.
These are the first steps in God teaching self control to man. It’s not perfect but it is a start. God needed man to establish a foothold somewhere, a “clean piece of land” where men treated each other with respect. Israel was that foothold.