Thanks for your question.
Numbers 20:7 And the LORD spake unto Moses, saying,
8 Take the rod, and gather thou the assembly together, thou, and Aaron thy brother, and speak ye unto the rock before their eyes; and it shall give forth his water, and thou shalt bring forth to them water out of the rock: so thou shalt give the congregation and their beasts drink.
9 And Moses took the rod from before the LORD, as he commanded him.
10 And Moses and Aaron gathered the congregation together before the rock, and he said unto them, Hear now, ye rebels; must we fetch you water out of this rock?
11 And Moses lifted up his hand, and with his rod he smote the rock twice: and the water came out abundantly, and the congregation drank, and their beasts also.
12 And the LORD spake unto Moses and Aaron, Because ye believed me not, to sanctify me in the eyes of the children of Israel, therefore ye shall not bring this congregation into the land which I have given them.
Psalms 106:32 They angered him also at the waters of strife, so that it went ill with Moses for their sakes:
Psalms 106:33 Because they provoked his spirit, so that he spake unadvisedly with his lips.
Moses was instructed to bring water out of the rock twice.
At Rephidim, in the 2nd month of the 1st year of the exodus, Moses was instructed to strike a rock with his rod to bring forth water.
Exodus 17:5 And the LORD said unto Moses, Go on before the people, and take with thee of the elders of Israel; and thy rod, wherewith thou smotest the river, take in thine hand, and go.
6 Behold, I will stand before thee there upon the rock in Horeb; and thou shalt smite the rock, and there shall come water out of it, that the people may drink. And Moses did so in the sight of the elders of Israel.
At Kadesh, in the 40th year of the exodus, Moses was again commanded to bring water out of a rock; but this time by simply speaking to it.
Because the people had made him angry, Moses did not give God the glory by saying "must we fetch you water out of this rock?” and disobeyed God by striking the rock instead of speaking to it.
So at the end of the 40 years Moses was allowed to view the land but refused entry.
Numbers 27:12 And the LORD said unto Moses, Get thee up into this mount Abarim, and see the land which I have given unto the children of Israel.
13 And when thou hast seen it, thou also shalt be gathered unto thy people, as Aaron thy brother was gathered.
14 For ye rebelled against my commandment in the desert of Zin, in the strife of the congregation, to sanctify me at the water before their eyes: that is the water of Meribah in Kadesh in the wilderness of Zin.
Deuteronomy 1:37... the LORD was angry with me for your sakes, saying, Thou also shalt not go in thither.
Deuteronomy 3:25 I pray thee, let me go over, and see the good land that is beyond Jordan, that goodly mountain, and Lebanon.
26 But the LORD was wroth with me for your sakes, and would not hear me: and the LORD said unto me, Let it suffice thee; speak no more unto me of this matter.
27 Get thee up into the top of Pisgah, and lift up thine eyes westward, and northward, and southward, and eastward, and behold it with thine eyes: for thou shalt not go over this Jordan.
The narrative of Numbers 27 is repeated in Deuteronomy 32.
Deuteronomy 32:48 And the LORD spake unto Moses that selfsame day, saying,
49 Get thee up into this mountain Abarim, unto mount Nebo, which is in the land of Moab, that is over against Jericho; and behold the land of Canaan, which I give unto the children of Israel for a possession:
50 And die in the mount whither thou goest up, and be gathered unto thy people; as Aaron thy brother died in mount Hor, and was gathered unto his people:
51 Because ye trespassed against me among the children of Israel at the waters of Meribah–Kadesh, in the wilderness of Zin; because ye sanctified me not in the midst of the children of Israel.
52 Yet thou shalt see the land before thee; but thou shalt not go thither unto the land which I give the children of Israel.
From Paul’s inspired commentary we learn that the rock represented Christ.
1 Corinthians 10:4 And did all drink the same spiritual drink: for they drank of that spiritual Rock that followed them: and that Rock was Christ.
We can deduce from this that Moses was unknowingly enacting in a parable the two advents of Christ.
The first time to be smitten and put to death as a sacrifice for his people.
The second time to be reconciled to his people by their supplication.
Isaiah 55:1 Ho, every one that thirsteth, come ye to the waters, and he that hath no money; come ye, buy, and eat; yea, come, buy wine and milk without money and without price.
John 4:14... whosoever drinketh of the water that I shall give him shall never thirst; but the water that I shall give him shall be in him a well of water springing up into everlasting life.
John 7:37 In the last day, that great day of the feast, Jesus stood and cried, saying, If any man thirst, let him come unto me, and drink.
The water out of the rock is emblematic of the words of life which emanate from Christ.
By his anger Moses destroyed the pattern.
In doing so he established another – the rock became to him a stone of stumbling as Christ would be to Israel.
Those in Israel who stumbled at Christ would not enter the promised land.
Isaiah 28:16 Therefore thus saith the Lord GOD, Behold, I lay in Zion for a foundation a stone, a tried stone, a precious corner stone, a sure foundation: he that believeth shall not make haste.
Isaiah 8:14 And he shall be for a sanctuary; but for a stone of stumbling and for a rock of offence to both the houses of Israel, for a gin and for a snare to the inhabitants of Jerusalem.
Acts 5:30 The God of our fathers raised up Jesus, whom ye slew and hanged on a tree.
31 Him hath God exalted with his right hand to be a Prince and a Saviour, for to give repentance to Israel, and forgiveness of sins.
Romans 9:32 Wherefore? Because they sought it not by faith, but as it were by the works of the law. For they stumbled at that stumblingstone;
33 As it is written, Behold, I lay in Sion a stumblingstone and rock of offence: and whosoever believeth on him shall not be ashamed.
1 Peter 2:8 And a stone of stumbling, and a rock of offence, even to them which stumble at the word, being disobedient: whereunto also they were appointed.
We are left with the example and the exhortation
Isaiah 51:1 Hearken to me, ye that follow after righteousness, ye that seek the LORD: look unto the rock whence ye are hewn, and to the hole of the pit whence ye are digged.
Moses refused inheritance in the land in his lifetime puts him with Abraham Isaac and Jacob who were promised an everlasting inheritance on the earth and must be raised from the dead to receive it.
Hebrews 11:13 These all died in faith, not having received the promises, but having seen them afar off, and were persuaded of them, and embraced them, and confessed that they were strangers and pilgrims on the earth.