In Parshat Shoftim in Perek 17, the Torah describes how a king should not take for himself too many wives and he should not own too many horses. The reason given for a king not having too many horses is in order that Klal Yisrael not return to Mitzrayim; a king should not have too many wives so that the king does not lead Klal Yisrael astray.
When Shlomo Hamelech was king he took 1,000 wives, much more than the eighteen-wife maximum allowed by the Torah. Shlomo also received as presents and bought many more horses than the Torah permits. The question is: how could a great Tzadik like Shlomo Hamelech violate this Aveirah? HaRav Leibush Charif answers as follows: Shlomo Hamelech knew the Halachah and the reason why HaKadosh Baruch Hu gave this as a Mitzvah to the king. Shlomo figured that this mitzvah did not apply to him; the reason given for a king not to have too many wives was in order that they not lead him and his nation astray. Shlomo decided he would be very careful not to lead Klal Yisrael astray. The reason given for a king not to have too many horses was in order not to lead Klal Yisrael back to Mitzrayim. Shlomo again decided that he would be careful not to lead Klal Yisrael to Mitzrayim. Therefore, the negative commandments of not taking too many wives and not having too many horses did not apply to him. In fact, Shlomo was wrong and was later punished very severely for these Aveirot. In fact, students of Sefer Melachim understand that Shlomo’s mistakes constituuted the first step towards the destruction of the first Beit HaMikdash.
We are now in the month of Elul, a time of repentance and introspection. Many of us tend to think that the act of Teshuvah does not apply to us; someone may think he is generally a “good guy” and does not do too many Aveirot, so he does not have to do Teshuvah. This outlook is wrong. Every single person, from the greatest Tzadik to someone who is not exactly the greatest Tzadik, must do Teshuvah. We should all learn from Shlomo’s mistake and not consider ourselves above Teshuvah. With this Teshuvah, may we be Zocheh to the rebuilding of the Beit HaMikdash BiMeheirah ViYameinu.