Why did he say "Tov v'Yashar Hashem"?
Rashi: He desires to vindicate His creations.
Radak: Therefore, he does not despise sinners. If they want to repent, He accepts them, and shows to them the straight path.
Malbim: Because He is Tov, He shows sinners the path. Because he is Yashar, He guides the humble - refer to 25:9:1:3].
What path does Hashem show sinners?
Rashi: Teshuvah. Radak - ba'Derech (with Patach under the Beis) is the known path, i.e. Teshuvah. It is known to people from the days of Bereishis; Hashem showed the path of Teshuvah to Kayin - "Im Teitiv Se'es" (Bereishis 4:7).
Rashi (from Makos 10b): Regarding Shogeg murderers, it says "Tachin Lecha ha'Derech" (Devarim 19:3). They write "Miklat" on the crossroads (to direct murderers to the refuge cities 1 ).
Makos 10b: Hashem shows the path to sinners, and all the more so to Tzadikim!