Rabbi David Fohrman's Aleph Beta series has an entire segment on this here.
Chizkiyahu had the potential to be moshiach. As such, every little "mistake" he made had huge consequences - just like we struggle to understand what was so bad about Moshe hitting the rock that it warranted him being kept out of Eretz Yisrael.
You are correct, the Temple will continue only as long as the Children of Israel are faithful and will be destroyed if they are not faithful.
Rashi on I Melachim 9:3 explains:
and My eyes and My heart shall be there at all times: Jonathan rendered: And My Shechinah shall dwell there if My will is done.
And My eyes and My heart shall be there: if My ...
According to Eikhah Rabba 1:53, the "repentance" was not complete. Apparently they agreed with the elimination of state sponsored or public idolatry, but when it came to their own homes, many schemed to get past the king's laws:
והוא לא היה יודע שכל דורו עובדי עבודת כוכבים היו? הוה משלח זוג תלמידים למיבערא עבודת כוכבים מבתיהון, והוון עללין ולא משכחין כלום....