Why was Hashem so impressed by Shlomo's answer?
'Rashi' (Divrei ha'Yamim II, 1:11): Only one with Yir'as Shamayim would ask for this - "Sechezeh mi'Kol ha'Am Anshei Chayil Yir'ei Elokim" (Shemos 18:21).
Malbim: If one told someone 'you may have a gem worth 1000, or a Sefer Torah worth 30, with a gem in it, surely he will take the latter! Through Chachmah, one gets also wealth, honor and long life ("Orech Yamim bi'Yminah?" - Mishlei 3:16) and victory in war ("Tovah Chachmah mi'Klei Kerav" - Koheles 9:18). Shlomo knew this at the time, like Shir ha'Shirim Rabah (1:9) says, 'I will ask for the king's daughter (Chachmah), and everything is included'! Hashem was impressed because Shlomo desired the Chachmah only to be able to judge Yisrael. 1
Malbim (Divrei ha'Yamim II, 1:11): It was not due to what Shlomo requested in the dream. The ideas that come on a man's Ru'ach during a dream are not based on intellect and choice. Rather, what he requested in the dream, his heart was always thinking about this when he was awake.
The Midrash implies that he was interested also in the other matters that one receives via Chachmah! (PF)