I’m looking at Yeshayahu 39 and Melachim 2 20. What was so bad about Chizkiyahu showing his treasures to the king of Bavel? If it was so bad, why was he not punished personally? It seems unfair to punish his descendants for his sin. I was wondering if G-d was angry that the Babylonians would learn how to duplicate the incense.
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.