“Throughout the narratives of Exodus 19-Deuteronomy there are numerous examples of Israel’s failure to follow God’s will. Here we can see the hand of the author at work. After each episode of disobedience we can see that God gave Israel a new and more complete set of laws.
As Israel continued to transgress the laws given to them, God continued to give them more. God did not give up on His people. When they sinned, he added laws to keep them from sinning further.
The laws were not added to keep them from sinning; the laws were added to keep them from disappearing into the world of sin around them. It thus was the transgressions of the people that provided the motivation for God’s giving the Mosaic law.
As the transgressions increased, more laws were added.”
–John H. Sailhamer, The Meaning of the Pentateuch (Downers Grove, IL: InterVarsity, 2009), 561.