Why is he called the greatest penitent?
Radak: He was zealous for Divrei Torah, and did everything like is written in the Torah. He removed the Bamos, and did not leave one. In his days, people offered only in the Beis ha'Mikdash. The kings before him, even though they had good deeds, did not remove the Bamos, like it says "Od ha'Am Mezabchim u'Mekatrim ba'Bamos"(Melachim I, 22:44, above 12:4, 14:4, 15:4, 35). Asa relied on Melech Aram and took the gold and silver from Otzeros Beis Hashem and sent it to him. Also, when he was sick, he did not seek Hashem (Divrei ha'Yamim II, 16:12). Yehoshafat helped the evil Malchei Yisrael and intermarried with them. Chizkiyah became haughty, and there was anger against him (ibid., 32:25). About Yoshiyah it says 'k'Chol Toras Moshe"!
Radak (citing Shabbos 56b, #1): Yoshiyah sinned, but he did a great Teshuvah.
Radak (citing Shabbos 56b, #2): "Asher Shav" teaches that he overturned every judgment he made from the age of eight until 18 1 . He paid from his money [to whomever might have lost due to a wrong verdict].
Rashi (56b): Until his 18th year of kingship, when they found the Sefer Torah. (An opinion in Shulchan Aruch says that one should not judge before 18 years old. Rashi's text 'Ben Shemoneh Esre' supports this, and also Radak implies like this.
Chizkiyah "trusted in Hashem, and there was no king like m afterwards" (18:5). How can our vs say that there was no one like Yoshiyah before him?
Malbim citing Mahari: Chizkiyah was greatest in Bitachon, e.g. regarding Sancheriv. Yoshiyah was greatest in Teshuvah. Even according to the opinion that he did not sin, he overturned every judgment he made before 18, and paid from his money. Malbim - I say that the Teshuvah was to make the generation repent from all the things that previous kings did to anger Hashem. He abolished the Mizbechos and Bamos from all cities of Yisrael. Chizkiyah left the Mizbe'ach in Beis Kel, the Bamos in cities of Shomron and the Mizbechos on Achaz' roof. Hashem wanted to make Chizkiyah Mashi'ach, and Sancheriv would be Gog and Magog, but a sin prevented this (Sanhedrin 94a). Had they done a full Teshuvah, all exiles would have returned and he would have been Mashi'ach. Now that they did full Teshuvah in Yoshiyah's time, Yirmeyah' thought that now is the time, so he returned the 10 tribes.
Yoshiyah was such a Tzadik - why did he die so young (39)?