We live in an environment of laws. They exist even if we don't like them. God created them to help us be happy and to give us choices. We can live in harmony with them or bump up against them. The decisions we make have consequences and it is our responsibility to live by those choices. We are being taught to mature as children of God.