I have to wonder why Moses died and if, had he not disobeyed God, he would have lived much longer. The Bible says that when Moses died, he was 120 years old but his eyesight hadn’t deteriorated and his “natural force” had not abated.
When the time came for the Israelites to enter the Promised Land, the Lord took Moses up into the mountain where He revealed some more information to him. Having taken down all the information the Israelites would need in the generations to come, Moses transferred his spiritual authority to Joshua, the new leader of the Israelites.
I have to wonder, that in transferring this spiritual authority, Moses’ purpose on earth was finished and therefore his need to be alive. God had promised Moses that he would be able to see the Promised Land, although he would not be allowed to set foot in it. Also, God very clearly told Moses to go up into the mountain where he would deliver the final words God would speak through him, see the Promised Land, transfer leadership of the Israelites to Joshua, and die. He would not be coming back down the mountain.
It can also be inferred from the number of occurrences, that Joshua was not the most brave or bold or secure of men. Apparently, he was afraid to lead the Israelites (with good reason, I would argue) and fearful of what lay before them, even though he was one of the two spies who brought back a good report of the Promised Land.
Moses encouraged Joshua repeatedly to be strong and of good courage and after Moses was gone, God Himself encouraged Joshua to be strong and of good courage… that He would not leave him and would not forsake him, but would lead him and the Israelites into the land He had promised them so long ago; they would be a nation yet, God’s chosen people.