Problem: There is no contradiction or difficulty here between Matthew 4:5, 8, and Luke 4:5, 9 and when the devil took Jesus to the Temple. All we need to do is put the verses from each gospel side by side to see the order of events. When we do that, we see that Jesus was led to high places three times. Take a look at the chart below.
Solution: Luke 4:5, “And he led Him up and showed Him all the kingdoms of the world in a moment of time.”
Matt. 4:5, “Then the devil took Him into the holy city and had Him stand on the pinnacle of the temple,”
Luke 4:9, “And he led Him to Jerusalem and had Him stand on the pinnacle of the temple…”
Matt. 4:8, “Again, the devil took Him to a very high mountain and showed Him all the kingdoms of the world and their glory.”
We quickly see that Luke 4:5 is the first mention of Jesus being taken anywhere and it simply says, “And he [the devil] led Him [Jesus] up and showed Him all the kingdoms of the world in a moment of time.” It isn’t until later in Luke 4:9 that Jesus is lead to the pinnacle on top of the temple. Therefore, the answer is simple: Jesus was “led up” and was shown the kingdoms of the world. Later He was led to the pinnacle.
To see the entire context of each of the verses, in order and compared to each other, please see the grid below.