Why are "Kol Darchei Ish Zach b'Einav"?
R. Yonah: Man's nature is, all Midos that he has from birth, they are straight in his eyes, whether they are good or bad. Therefore, it is hard to fix Midos.
Malbim: There are many ways of the Nefesh. Man cannot choose the clear path without any dross. Only Hashem, who measures the Ru'ach that puts images on the heart, can. Sometimes man goes in the way of Tzedakah and mercy, and via this he comes to pride - he does Tzedakah to glorify himself. He goes in the way of humility and lowliness, and the source in his Ru'ach is from pride. He wants that people will say that he is humble!
Why does it say "v'Sochen Ruchos Hashem"?
Rashi: He counts the hearts - who is good and who is evil.
R. Yonah: He helps man to fix Midos - to contemplate their crookedness and to invigorate himself to fix them. One cannot defeat inborn nature without Shamayim's help. Hashem is "Bochen Libos" (17:3). When man requests to prepare his heart for Avodas Hashem and fear of Him, they will help him to fix the heart and straighten Midos. "Tochen" is like "Tikanti Amudeha Selah" (Tehilim 75:4), "v'Lo Niskenu Alilos" (Shmuel I, 2:3).
Malbim: There is a scale for the Ru'ach. The king and Kohen Gadol, whose Ru'ach is elevated, he needs to go in a higher way - "va'Yigbah Libo b'Darchei Hashem" (Divrei ha'Yamim II, 17:6). Man does not know this, only Hashem [decided the proper paths], based on the laws of Chachmah.