"And he sought God in the days of Zechariah, who had understanding in the visions of God: and as long as he sought the LORD, God made him to prosper." (2 Chronicles 26: 5)
Uzziah was a good king, but he was not perfect. His name means "God is my strength", but when he forgot that, he was hit with leprosy.
Now, the Book of Chronicles in the Bible related the history of the Israelites, with a perspective on the grace of God.
The account in Second Kings is smaller and less gracious:
"1In the twenty and seventh year of Jeroboam king of Israel began Azariah son of Amaziah king of Judah to reign. 2Sixteen years old was he when he began to reign, and he reigned two and fifty years in Jerusalem. And his mother's name was Jecholiah of Jerusalem. 3And he did that which was right in the sight of the LORD, according to all that his father Amaziah had done; 4Save that the high places were not removed: the people sacrificed and burnt incense still on the high places. 5And the LORD smote the king, so that he was a leper unto the day of his death, and dwelt in a several house. And Jotham the king's son was over the house, judging the people of the land." (2 Kings 15: 1-5)
There is no reason indicated why Amaziah (Uzziah's other name) was hit with leprosy.
In the Chronicles account, we find out why:
"But when he was strong, his heart was lifted up to his destruction: for he transgressed against the LORD his God, and went into the temple of the LORD to burn incense upon the altar of incense. 17And Azariah the priest went in after him, and with him fourscore priests of the LORD, that were valiant men: 18And they withstood Uzziah the king, and said unto him, It appertaineth not unto thee, Uzziah, to burn incense unto the LORD, but to the priests the sons of Aaron, that are consecrated to burn incense: go out of the sanctuary; for thou hast trespassed; neither shall it be for thine honour from the LORD God. 19Then Uzziah was wroth, and had a censer in his hand to burn incense: and while he was wroth with the priests, the leprosy even rose up in his forehead before the priests in the house of the LORD, from beside the incense altar. " (2 Chronicles 26: 16-19)
Then he began to think of himself as so strong that he could enter into the Holy of Holies to offer sacrficies, he in effect declared that he could provide his atonement.
Here we see what Jude would call "the rebellion of Korah" (Jude 11), in which man thinks that there is something that he can do to make himself good before God.
Now, Uzziah was struck with leprosy, but the consequences for attempted usurpation of the priest's role should have been far worse:
"6And I, behold, I have taken your brethren the Levites from among the children of Israel: to you they are given as a gift for the LORD, to do the service of the tabernacle of the congregation. 7Therefore thou and thy sons with thee shall keep your priest's office for every thing of the altar, and within the vail; and ye shall serve: I have given your priest's office unto you as a service of gift: and the stranger that cometh nigh shall be put to death." (Numbers 18: 6-7)
Uzziah could have been killed, but the blood of bulls and goats continued to atone for his sins. Today, the blood of Jesus cleanses us of all sin (1 John 1: 7)
Today, because of Jesus and God's grace revealed in Him (John 1: 17), we are kings and priests:
"But ye are a chosen generation, a royal priesthood, an holy nation, a peculiar people; that ye should shew forth the praises of him who hath called you out of darkness into his marvellous light" (1 Peter 2: 9)
Uzziah wanted to be a priest. Today, we are all priests, and witnesses of God's grace.