They were in the desert 40 years because they took counsel of their fears and did not trust God and the counsel of Joshua to go in and possess the land.
So God led them through the desert until all the generation of the faithless and disobedient had died.
It was the exact opposite of holding the line.
As indeed even a later prophet said of them,
“Did you bring to me sacrifices and offerings the forty years in the wilderness, O house of Israel? 26 You shall take up Sakkuth your king, and Kaiwan your star-god, your images,[a] which you made for yourselves; 27 therefore I will take you into exile beyond Damascus,” says the Lord, whose name is the God of hosts.
--Amos 5:25-27
They were in the desert 40 years because they took counsel of their fears and did not trust God and the counsel of Joshua to go in and possess the land. So God led them through the desert until all the generation of the faithless and disobedient had died.
It was the exact opposite of holding the line.
As indeed even a later prophet said of them,
“Did you bring to me sacrifices and offerings the forty years in the wilderness, O house of Israel? 26 You shall take up Sakkuth your king, and Kaiwan your star-god, your images,[a] which you made for yourselves; 27 therefore I will take you into exile beyond Damascus,” says the Lord, whose name is the God of hosts. --Amos 5:25-27