Rashi, Lev. 4:22 (link), quotes the Midrash and Gemara:
Fortunate is the generation whose leader is concerned to bring an atonement for his inadvertent transgression — all the more so that he regrets his intentional transgressions.
The Maharal in Gur Aryeh explains:
The generation is praiseworthy because they did not sin but have a leader who, if he sins, regrets his mistake. We can also explain that specifically here it says that the generation is praiseworthy because from that he [the leader] regrets his mistake, it is clear that he is not embarrassed to say “I sinned” and does not say “I am great and important, how can I say ‘I sinned’?”