Why did Hashem promise long life only if he will go in His way? He promised wealth and honor without any condition!
Rashi citing Sifri Devarim 162: The Torah did not promise wealth and honor to a king; this I will give to you whether or not you are worthy. Long life and continued kingship, the Torah stipulated "ul'Vilti Sur Min ha'Mitzvah? Lema'an Ya'arich Yamim Al Mamlachto" (Devarim 17:20). I will not change this; if you will go in My ways, I will lengthen your days. The same applies to kingship of generations after him - "if you will go in front of Me? will not be cut off for you [a man from the throne of Yisrael]" (9:4-5). Radak - Shlomo did not go in Hashem's ways; he lived only to be 52. However, he had wealth and honor all his days.
Malbim (from Shabbos 63a): "Orech Yamim bi'Yminah?" (Mishlei 3:16) - only for people who are Maimin (meticulous, like the skilled right hand; alternatively, Lishmah) about Torah get length of days, and all the more so wealth and honor. "Bi'Smolah Osher v'Chavod" (ibid.) - those who are Masmilin (lethargic; alternatively, Lo Lishmah) about Torah get wealth and honor, but not length of days.