بسم الله الرحمن الرحيم
Due to the punishment from Allah for their refusal to enter the Holy Land when commanded, Banu Isra'il spent forty years wandering aimlessly in the desert. Entry into the Holy Land was in fact prohibited for them until all the adult members of the rebellious generation had passed away. Only then were their descendants able to cross the River Jordan and move towards Jericho in Palestine.
Despite it being his earnest wish, even Musa (as) did not live to enter the Holy Land. His brother Haroon (as) had died earlier and the time of the passing of Musa (as) also came before this desired objective was achieved.
There is a hadith Qudsi which relates to the death of Musa (as). Abu Hurayrah (may Allah be pleased with him) reports that the Prophet (peace and blessings be upon him) said:
"The angel of death was sent to Musa. When he came to Musa, Musa slapped him on the eye. The angel returned to Allah and said: 'You have sent me to a servant who does not want to die'. Allah ordered the angel, 'Return to him and tell him to put his hand on the back of an ox and for every hair that will come under it, he will be granted one year of life'. Musa said, 'O Lord! What will happen after that?' Allah replied, 'Then death'. Musa decided, 'Let it be now'. Musa then requested Allah to let him die close to the Sacred Land, so much so, that he would be at a distance of a stone's throw from it."
Abu Hurayrah (may Allah be pleased with him) added that the Prophet (peace and blessings be upon him) then said: "If I were there, I would show you his grave below the red sand hill on the side of the road". (Bukhari)
From this hadith we learn that even though Musa (as) did not live to enter the Holy Land, Allah nevertheless honoured him by allowing him to die close to the blessed land.