The temptation of Jesus was part of God's provision for man to live a righteous life.
If Christ wasn't tempted, man would have hide himself under the lies of the devil, as to no one can live a sinless life.
Christ did that as a man which shows some things we can also do as a man when we rely upon what Christ relied on - God's Word.
It also revealed the need for man to be watchful and be spiritually inclined.
Let me allow others to answer your question.