The Lord bade the Hebrews return and go into the wilderness by the way of the Red Sea. They were very near the good land, but, by their wicked rebellion, they forfeited the protection of God. Had they received the report of Caleb and Joshua, and gone immediately up, God would have given them the land of Canaan. But they were unbelieving and showed such an insolent spirit against God that they brought upon themselves the denunciation that they should never enter the Promised Land. It was in pity and mercy that God sent them back by the Red Sea, for the Amalekites and Canaanites, while they were delaying and murmuring, heard of the spies and prepared themselves to make war with the children of Israel. SR 162.2
“And the Lord spake unto Moses and unto Aaron, saying, How long shall I bear with this evil congregation, which murmur against Me? I have heard the murmurings of the children of Israel, which they murmur against Me.” The Lord told Moses and Aaron to say to the people that He would do to them as they had spoken. They had said, “Would God we had died in the land of Egypt! or would God we had died in this wilderness!” Now God would take them at their word. He told His servants to say to them that they should fall in the wilderness, from twenty years old and upward, because of their rebellion and murmurings against the Lord. Only Caleb and Joshua should go unto the land of Canaan. “But your little ones, which ye said should be a prey, them will I bring in, and they shall know the land which ye have despised.” SR 163.1
The Lord declared that the children of the Hebrews should wander in the wilderness forty years, reckoning from the time they left Egypt, because of the rebellion of their parents, until the parents should all die. Thus should they bear and suffer the consequence of their iniquity forty years, according to the number of days they were searching the land, a day for a year. “And ye shall know My breach of promise.” They should fully realize that it was the punishment for their idolatry and rebellious murmurings which had obliged the Lord to change His purpose concerning them. Caleb and Joshua were promised a reward in preference to all the host of Israel, because the latter had forfeited all claim to God's favor and protection. SR 163.2