Kindergarten teachers often have a set of classroom rules. They want to teach their children the ABCs and the fundamentals of reading, and they know that will happen more effectively if everyone in the class has mutual respect. For many of those kindergartners, their time in class is the first extended time in community, and they have to learn how to get along.
When Yahweh liberated Israel from Egypt, they had a new life. They had lived in community with one another for generations, but never as His covenant people. Now, they would be representing Him by the way they worshiped and the way they lived.
As a result, Yahweh gave them an extensive list of community rules. Their worship of Yahweh and their respect for Him would create a new culture among themselves. They would value one another more highly. They would respect private property and promote community flourishing. They had never had the blessing He was going to provide, so they had to learn how to live humbly and selflessly for His glory and their good.
God had made them in His image. They all had personal agency and the ability to live with responsibility. Because Yahweh had cared for them when they were vulnerable, they would become a nation that cared for those who were vulnerable around them (22:21-27). He was calling them to be holy, as He was holy, to be different from all around (22:31).
Praise God for new life in Christ and the call to be holy.