1.24 Why did the people of Israel wander in the desert for 40 years?
The ancestors of the nation that was later called Israel had gone to Egypt in a time of famine. They were later oppressed as slaves by the pharaoh of Egypt. God chose Moses to free his people and to lead them to a better life in the Land that he had promised to their ancestors centuries earlier.
The pharaoh did not want to let the Israelites go, and so God sent disasters to him. Then the people were allowed to leave and they travelled through the desert. Because the Israelites failed to obey God and often broke his commandments, they were punished with 40 years of wandering before arriving in the Promised Land.
> Read more in the book
The Wisdom of the Church
This is what the Popes say
The journey of the Jewish people from Egypt to the Promised Land lasts for 40 years, an appropriate span of time to experience God’s faithfulness. "You shall remember all the way which the Lord your God has led you these forty years in the wilderness… your clothing did not wear out upon you, and your foot did not swell, these forty years”, Moses says in Deuteronomy at the end of the 40 years' migration (8:2,4). [Pope Benedict XVI, General Audience, 22 Feb. 2012]