I listened to a homily recently on the baptism of Jesus. The homilist pointed out that "the Spirit drove him out into the desert, and he remained [...] tempted by Satan." (Mk 1:12-13) The accounts of Mark and Luke (Mt 4:1, Lk 4:1) use the text "led by the spirit [...] to be tempted."

This sojourn into the desert was not Jesus' idea. His Father had a clear purpose for these 40 days of solitude - to be tempted by Satan. If the Spirit drove him with a purpose, it is also likely that Jesus did not wander aimlessly through his 40 days.