If the two of them don't do this, he can't change people's views on them. Emperor Taizong needs to set up a benevolent man for himself to rule the society. After all, he didn't come to be emperor at that time, because he killed all his brothers, so he could be emperor himself. Therefore, in order not to be criticized by future generations or even people at that time, he can only set the principle of three mirrors.
Therefore, during the reign of Emperor Taizong, we can know that Wei Zhi protested in anger, while Emperor Taizong knew the truth and turned a blind eye to some small mistakes. Their mutual use has been going on for some time. With the end of Wei Zhi's life, the performance also came to an end.
But later, Emperor Taizong discovered that Wei Zhi secretly wrote some of his deeds into history before his death and sent them to historians. As we all know, historians record the words and deeds of the monarch for future generations' reference or study. So Emperor Taizong was very angry about such a thing, because it would upset the balance between them. Wei Zhi can always have a good reputation, but Emperor Taizong can't, so he is very angry.