Moses was a great man and prophet of God, but he had a couple things working against him.  First, he couldn't speak well, so God gave him Aaron as a mouthpiece in the carrying out of His will.  Second, he had an uncontrollable temper, brought on by righteous anger. This was shown first when he slew the Egyptian who was smiting a Hebrew, one of his brethren.  Then when he broke the first tables of God's 10 commandments out of anger of his people, God restored them back to him.  

Moses represents the law.  The rock represents Jesus (I Cor. 10:4). The promised land represents a type of heaven.  The first time Moses struck the rock out of obedience it represented the death of Jesus on the cross.  But the second time God told him to speak to the rock. By disobeying God, through his righteous anger of the rebelliousness of the people, Moses was showing symbolically crucifying Christ again. This was not God’s plan.  Christ died once for sin (Rom. 6:10).  Moses’ mistake was he didn’t believe the LORD, by his disobedience, to sanctify Him in the eyes of the children of Israel; therefore he was not allowed to bring them to the promised land (Num. 20:10, 12, 13). 

Joshua is the Hebrew name for Jesus.  Joshua's faith in, and obedience to God was the chosen vehicle to then get them to the promised land.