Moses, on the shore of the Red Seal, the Israelites with him, frightened, and the Egyptians coming up behind them: "Fear not! Stand your ground, and you will see the victory the Lord will win for you today...The Lord Himself will fight for you, you have only to keep still." And the next day, they crossed the sea on dry seabed.
When they got to Sinai, God told Moses to call the people together. They agreed that "Everything the Lord has said, we will do." Then God delivered ten commandments to the people, and dictated four chapters of instructions to Moses for the people. God called Moses out of a cloud to come up the mountain for 40 more days. Meanwhile, back at the camp, the people got restless, and asked Aaron to make a god for them. God told Moses to go back down, as the Israelites were running wild, and He was ready to wipe them all out and make a nation from Moses. Moses faced up to God with the promises to Abraham, Isaac and Jacob, and the Lord relented.
As they approached their promised destination, Moses sent a team of spies, one man from each tribe, to move up through the Negeb into the land beyond and check it out. The spies came back in 40 days and reported that the land was fruitful but the inhabitants were too strong. Amid the wailing and grumbling, Moses and Aaron fell on their faces before the people with no reported reply, and it was Joshua and Caleb who stood up to the whole community and said, "..You need not be afraid of the people..the Lord is with us." The Lord told Moses, "of all the men who have seen my glory and the signs I worked in Egypt and in the desert, and who nevertheless have put Me to the test already and have failed to heed my voice, not one shall see the land which I promised on oath to their fathers."--except Caleb and Joshua.
After another attempted rebellion, they moved back into the desert to Meribah, where there was no water--and the usual complaining from the people. God told Moses and Aaron to gather the people, and tell the rocks to give water. They assembled the community, and Moses said "Listen to me, you rebels! Are we to bring water for you out of this rock?", and struck the rock. But the Lord said to Moses and Aaron, "Because you were not faithful to me in showing my sanctity before the Israelites, you shall not lead them into the land I will give them."
Reading this by itself, it looks like this is a punishment out of proportion to the offense. However, look at it in the context of the whole relationship between God, the Israelites, Moses and Aaron. After starting out speaking in the name of God, Moses more and more talked about his frustration with the people, and less and less about God. At Meribah, Moses did not even mention God when he came in front of the people; his answer was to do something himself when he had been told to command the rock in the name of the Lord. They had not only failed to invoke God at this time; they had not taught the people to respect the plans of God and have faith in His promises. At the time of the golden calf incident, the people --and Aaron--had just a few weeks earlier heard God tell them to stay away from idols. When the spies came back, Moses and Aaron said nothing, and Joshua and Caleb said what needed to be said--and when God said that no one there except Joshua and Caleb would see the Promised Land--Moses was there.
We don't hear a lot about Joshua in the books of the Torah, but he's there when he needs to be. And it was Joshua who did lead the Israelites into the Land--with strict injunctions that they were not to profit by the conquest; that it was to be for the glory of God. A thousand years later, when the descendants of these people had been in captivity again, this time in Babylon and were coming back into Judea to rebuild, the prophet Zechariah said “This is the word of the Lord to Zerubbabel (the leader of the returning exiles) 'Not by might nor by power, but by my Spirit,’ says the Lord Almighty."* This was true for Joshua; it has always been true for the people of God. *Zechariah 4:6