By the grant of Allah Ta'ala, the Holy Prophet (Sallallahu alaihi wa sallam) would see the wonders of nature and the realities of the heavenly worlds with His blessed eyes and would see Jannah and hell.
Without journeying Him through the cosmos, Allah Ta'ala would grant Him the vision of heavenly worlds, the La Makaan and Jannah and hell as well, as given in this Hadith of Sahih Bukhari:
The Holy Prophet (Sallallahu alaihi wa sallam) performed Salaat Ul Kusuf. The Sahabah said: O Prophet of Allah (Sallallahu alaihi wa sallam)! We saw that you made a move to take something in your blessed hand, then drew back. The Holy Prophet (Sallallahu alaihi wa sallam) said: Verily! Jannah was presented before me and I decided to take a bunch of grapes from it (then I changed my decision) and if I had taken it, then you would have been eating from it until the end of the world and it would never have been finished. (Sahih Bukhari, Hadith No. 706)
When the Holy Prophet (Sallallahu alaihi wa sallam) sees the heavenly worlds from this earth itself, why was He (Sallallahu alaihi wa sallam) taken for a tour of those worlds? Apart from showing the wonders of nature, it was the intent of Allah Ta'ala to grant the Holy Prophet (Sallallahu alaihi wa sallam) special proximity and to grant Him the honor of conversing and seeing Allah Ta'ala.
He (Sallallahu alaihi wa sallam) was busy in spreading and propagating the Islam and inviting people towards Islam. Those who realized the value of Him and His message attached themselves to Him, but those who refused to recognize the value continued in their waywardness, prejudice and enmity. After seeing this, the Holy Prophet (Sallallahu alaihi wa sallam) journeyed to Taif.