Answer: Since before the Exodus, the Israelites had a tendency to whine and complain about a whole host of things, including their leaders like Moses.
Sometime after leaving Egyptian slavery they had a dire need for water. Instead of asking and having faith in God, they turned to complaining against their human leaders who were Moses and Aaron. They whined about being brought out to the wilderness so that, they assumed, both they and all they possessed would be no more.
Why did you bring us out of Egypt into this miserable place where nothing will grow? . . . There is not even any water to drink! (Numbers 20:5).
What was the solution to the problem of no water for the people, cattle, and so on in the desert wilderness of Zin? God stated that they they were to, before the entire population that left Egypt, take Aaron's rod and speak to a certain rock (Numbers 20:8). After they did this, water would miraculously come out of the rock and give much needed water to the the people.
The two leaders of Israel did most of what God commanded, except that they were so angry with the people that they made it appear as if they, by their own power, were quelling the thirst of the people. The Bible records that they said the following.
Hear now, you rebels! Must we (not God) bring water for you out of this rock?" (Numbers 20:10).
This was followed by Moses striking the rock twice, with the rod they brought, instead of speaking to it as the Eternal commanded (Numbers 20:11).
In verse 12 we find God leaves no doubt as to why his chosen two leaders didn't go into the land of milk and honey promised to Abraham, Isaac and Jacob.
Then the Lord spoke to Moses and Aaron, 'Because you did not believe Me, to hallow Me (proclaim my name holy) in the eyes of the children of Israel, therefore you shall not bring this assembly into the land which I have given them.' (Numbers 20:12).
Aaron died, as God said in verses 12 and 24, for his part in the rebellion at the rock of Meribah. He died on Mount Hor (Numbers 20:25 - 28), which is thought to have been directly south of Jerusalem.
God allowed Moses, before he died at Mount Nebo (located directly east of Jerusalem), to view the broad panorama of the land inheritance he swore to give the descedants of Abraham, Isaac, and Jacob (Deuteronomy 34:4 - 5).
After the death of Moses his body was buried by the Eternal in a special place no one would be able to find. It is interesting to note that Mount Nebo is at a higher elevation than Mount Hor, thus providing a more spectacular view of the Promised Land God was to give the Israelites as an inheritance.