“Yahweh struck King Azariah, so that he was a leprous to the day of his death. He lived in a separate house. Jotham the king’s son was in charge of the palace, governing the people of the land.”
For some unstated reason here, Yahweh struck this so-called good king with leprosy. Thus he had to live in a separate house because of the interdiction against lepers. His son Jotham became king in all practical matters. 2 Chronicles will give a further explanation of this, but here there is no explanation.