 The purpose was twofold. In Leviticus chapter 23, God told them, All native-born Israelites are to live in such shelters, so your descendants will know that I had the Israelites live in temporary shelters when I brought them out of Egypt. But the event was also to be festive. Rejoice before the Lord your God for seven days, says verse 40.