If the Israelites want the land, they better obey the law. No messing around.
Moses reminds them of what happened at Baal-Peor in Numbers 25. Some of the Israelite men had sex with Moabite women and bowed down to false gods. Sounds like a juicy story.
Bottom line, says Moses: don't do that.
If the Israelites obey the law, the other nations will see their wisdom and think that they're great. Because God proved his power to the Israelites, they now get to be examples for the world.
Moses warns the people not to worship idols.
He reminds them of a time on Mt. Horeb when they heard the Lord's voice but did not see his physical form. Because God has no specific form, the Israelites aren't supposed to make or worship images. And while they're at it, they shouldn't worship the sun, moon, or stars either. The people learn that Moses will not see the Promised Land because of them. We wonder how guilty they felt.
In verses 25-29, we get some foreshadowing of the Babylonian Exile. In 587 BCE, The Babylonians exiled the Israelites from the land and scattered them throughout the Babylonian Empire. Because of the pretty clear allusion to this historical event, many scholars think that the book of Deuteronomy was written after the Exile.
Oh, you want to know why the people will be exiled? Because of idol worship.
While they're in exile, the people will call upon God in exile, and God will hear them if they search with all of their heart and soul. After all, the Israelites are unique because they have heard the voice of God.
Next up, Moses tells the people to acknowledge that there is only one God (35-40). That might not seems like a huge deal, but it is. In other places in the Bible (think Exodus), we know God is the best, but he's definitely not the only.
Moses tells the people to set apart cities of refuge on the eastern side of the Jordan. People who accidently kill someone may flee to these cities. Translation: people who commit certain types of sins don't necessarily have to be executed, but they do have to be sent away.
P.S. Just to recap, the writer tells us that Moses gave these laws to the people in the land of the Amorites. (Yeah, the text likes to go in and out of voice sometimes. Go figure.)