Answer:
In short: he had to keep a promise he made.
Step-by-step explanation:
Way back when he wanted to marry Helen and realized he couldn't, he swore an oath to protect her and whoever her husband ended up being.
The Trojan War was pretty much all because of Helen. It began when she was kidnapped by Paris** and Helen was basically the focal point of the war.
Odysseus left Ithaca to fulfill his oath to protect Helen.
** It is not clear if she was kidnapped or went willingly to elope, but, in The Iliad, it is portrayed as a kidnapping.