There are many places in the Torah where we are commanded to do something, but it seems to be a result of a sin we may have done. Therefore, we will analyze some of the cases and see what the root of the commandment really is. Before we start, there are 2 things you should be aware of:
1. This isn't going to include things like burning down an asheira tree, where we are getting rid of evil. It is meant as a vehicle to take something seemingly wrong and "do it right".
2. The word mitzvah is commonly mistranslated as a "good deed". For example it is a "good thing" to keep Shabbos. However, the root "tzivah" really means commandment. Not all commandments are inherently good. They may make us better people at the end of the day, but you cannot read this without first realizing that a mitzvah is NOT a good deed.
APPOINTMENT OF A KING
(ט) וזה היה חטאם של ישראל בדבר המלוכה אשר שאלו, והוא ענין נתקשו בו הרבה מן הראשונים, כי אחרי שהיו מצווים להקים עליהם מלך כמו שנאמר כי תבא אל הארץ וגו' ואמרת אשימה עלי מלך ואמרו רז"ל (סנהדרין ב) שהיא אחת מג' מצות שנצטוו ישראל בכניסתן לארץ א"כ מה פשעם ומה חטאתם כששאלוהו:
(י) אבל על דעתי הוא כך, שהם רצו שעקר המשפט במה שבין אדם לחבירו יהיה נמשך מצד המלכות, והוא אומרו (שמואל א' ח') ויתקבצו כל זקני ישראל ויבואו אל שמואל הרמתה ויאמרו אליו הנה אתה זקנת ובניך לא הלכו בדרכיך עתה שימה לנו מלך לשפטנו ככל הגוים, ופירושו אצלי הוא כך שהם ראו שמה שצריך לסדור המדיני יהיה מתוקן כשימשך מצד המלכות משימשך מצד השופט, ולכן אמרו הנה זקנת ולא תוכל לשפוט עוד ובניך אינם ראוים שיחול בנו הענין האלהי על ידיהם כי אינם הולכים בדרכיך, ולכן ראוי שיהיה לנו מלך ושיהיה משפטנו על פיו, והוא אמרם שימה לנו מלך לשפטנו ככל הגוים, והם שגו בזה כי בני שמואל עם היות שלא היו חסידים כאביהם מ"מ לא היו מעוותי משפט כמ"ש בפ' במה בהמה יוצאה (שבת נו) אמר ר"ש בר נחמני אמר ר' יונתן כל האומר בני שמואל חטאו אינו אלא טועה שנא' ויהי כי זקן שמואל וכו' ולא הלכו בניו בדרכיו בדרכיו הוא דלא הלכו הא מחטי לא חטאו אלא מה אני מקיים ויטו אחרי הבצע ויקחו שוחד שלא עשו כמעשה אביהם שהיה שמואל הצדיק מחזר בכל מקומות ישראל ודנם בעריהם שנאמר וסבב בית אל והגלגל והמצפה ושפט את ישראל והם לא עשו כן אלא ישבו בעריהם כדי להרבות שכר לחזניהם ולסופריהם, וכיון שלא היו מעוותי משפט ימשך מצד שופטם את ישראל כפי התורה שיחול ענין האלהי בהם, אלא שישראל נטו בעת ההיא יותר לתקון קבוצם המדיני, ואלו שאלו להם מלך בסתם שיאמרו שימה לנו מלך, או שיבקשוהו לסבת תקון מלחמותיהם לא ימצא להם בדבר הזה עון אשר חטא אבל מצוה, אך הי' חטאתם באמרם שימה לנו מלך לשפטנו ככל הגוים, שרצו שיהיו משפטיהם נמשכים מצד המלכות לא מצד שופטי התורה, ויורה על זה מה שכתוב אחריו וירע הדבר בעיני שמואל כאשר אמרו תנה לנו מלך לשפטנו, לא אמר כאשר אמרו תנה לנו מלך בלבד כי לולי אמרו כן לא היה רע בעיניו, אבל מה שהוקשה לו באשר אמרו לשפטנו, ומפני זה אמר ה' לשמואל לא אותך מאסו כי אם אותי מאסו ממלוך עליהם. כי הם בוחרים בתקון ענינם הטבעי משיחול בהם ענין האלי.
(יא) וכשהוכיחם שמואל לא נעתקו מכונתם אבל היטיבו מעט שאלתם לומר כי אינם שואלים המלך מצד המשפט לבד אבל מצד תקון מלחמותיהם, והוא אמרם והיינו גם אנחנו ככל הגוים ושפטנו מלכנו ויצא לפנינו ונלחם מלחמותינו, ולכן הוכיחם שמואל ואמר גם עתה התיצבו וראו את הדבר הגדול הזה אשר ה' עושה הנה קציר חטים היו אקרא אל ה' ויתן קולות ומטר. ופירושו הוא דעו שגגתכם אשר בחרתם בבמה שיראה בעיניכם מתוקן סדור עניניכם הטבעי, שאינו כן. אבל הדבר בענין האלהי משנה ענין הטבעי ברצונו, כי הנה קציר חטים היום איננו ראוי לגשם ומטר כפי ענינו הטבעי, אבל מצד ענין. האלהי הדבק בי אקרא אל ה' ויתן קולות ומטר. ולכן היה ראוי לכם לבחור יותר במה שיחול ממנו הענין האלהי בכם והוא משפט השופטים שכתוב בם ושפטו את העם משפט צדק יותר ממשפטי המלכות אשר יעשה כרצונו, שזה ההבדל בין השופט והמלך. שהשופט משועבד יותר למשפטי התורה מהמלך, ומפני זה הזהיר המלך וצוהו שיהא לו ספר תורה שני ויביא עמו, וזהו אמרו והיה כשבתו על כסא ממלכתו וכתב לו וגו' והיתה עמו וגו' לבלתי רום לבבו, כלו' שמתוך שהמלך רואה שאינו משועבד למשפטי התורה כמו השופט צריך אזהרה מרובה לבלתי יסור מן המצוה ימין ושמאל ולבלתי רום לבבו מאחיו כפי היכולת הגדול שנותן לו הש"י, אבל בשופט לא הוצרך בכל אלו האזהרות לפי שיכלתו מוגבל כפי משפט התורה באמרו ושפטו את העם משפט צדק, והזהירו שהמשפט ההוא לא יטהו בשום פנים באמרו לא תטה משפט.
(9) And this was the sin of Israel in requesting a king, a matter which many of the earlier authorities find very perplexing, viz.: if they were commanded to appoint a king, as it is written (Deuteronomy 17:14): "And when you come to the land… and you will say: 'I will place a king over me…'", this being one of the three things they were commanded to do upon entering the land, according to our sages of blessed memory (Sanhedrin 20b) — then what was their sin in requesting a king?
(10) In my view it was this: they desired that the administration of justice between man and his neighbor be preponderantly in the hands of the king. This is the intent of the verse (I Samuel 8:4-5): "And all the elders of Israel gathered together and they came to Samuel to Ramah, and they said to him: 'You have grown old, and your sons have not gone in your ways; now place a king over us to judge us as all the nations.'" I understand this as follows: The Jews saw societal good as being better served by a king than by judges. Therefore, they said: "You are old and cannot judge anymore, and your sons are not worthy of investing us with the Divine Immanence, for they do not walk in your ways. Therefore, it is fit that we have a king and that we be judged through him." This is the intent of "Place a king over us to judge us as all the nations." And they were greatly mistaken in this. For the sons of Samuel, though they were not so saintly as their father, were still not perverters of judgment, as stated by our sages of blessed memory (Sabbath 55b): "R. Shmuel b. Nachmani said in the name of R. Yonathan: 'All who say that the sons of Samuel sinned are greatly mistaken, as it is written (I Samuel 9:1-3): "And it was when Samuel became old… and his sons did not walk in his ways" — they did not walk in his [exceptionally saintly] ways, but they did not sin. How then, am I to understand (Ibid 2): "And they turned aside after profit, and they took bribes, and they perverted judgment"? They did not emulate the example of their father. For Samuel, the righteous one, would make the circuit of all the places of the Jews and judge them in their cities, as it is written (Ibid 7:16): "And he made the circuit of Beth-El, Gilgal, and Mitzpeh, and he judged Israel." But his sons did not do thus, but sat in their cities in order to increase the income of their deputies and scribes.'" And since they did not, for all of this, pervert judgment [in the literal sense], their judging of the Jews in accordance with the Torah would still have resulted in Israel's being invested with the Divine Immanence, but the Jews at that time gave greater priority to governmental considerations. If they had simply asked "Place a king over us," or if they had specifically requested a king to lead them in their wars, there would be no sin in this, but, to the contrary, it would be a mitzvah. Their sin lay in asking: "Place a king over us to judge us as all of the nations," the judgment to come from the king and not from the judges of the Torah. This interpretation is substantiated by Samuel's reaction (Ibid 8:6): "And it was evil in Samuel's eyes when they said: 'Give us a king to judge us.'" It is not simply written "Give us a king," for if they had said only this, it would not be evil in his eyes. What disturbed him was "to judge us." and because of this G-d said to Samuel (Ibid 7): "It is not you they have rejected, but they have rejected My rule over them." That is, they prefer natural government to Divine Immanence.'"
(11) And when Samuel reproved them, they did not abandon their original intent, but only slightly ameliorated their request, saying that they desired a king not for judgment alone but for leadership in war. This is the intent of (Ibid 20): "And we, too, will be as the other nations, and our king will judge us, and he will go out before us, and he will fight our wars." And, therefore, Samuel rebuked them afterwards, saying (Ibid 12:16-17): "Even now, stand and see the great thing that the L-rd will do before your eyes. It is the time of the wheat harvest today; yet I will call upon the L-rd and He will bring thunder and rain." That is, know that you have erred in choosing a king on the basis of the assumption that your natural needs will be better served thereby. For it is not so, but, to the contrary, one who cleaves to the L-rd can alter the natural order according to His will. For it is the time of the wheat harvest today, a time of no rain within the natural order; but, by means of the Divine Immanence that cleaves to me, I will alter the natural order and He will bring thunder and rain. Therefore, you should have chosen what would have been likely to invest you with the Divine Immanence — the justice of the judges, concerning which it is written: "and let them judge the people a righteous judgment" — more than the justice of the king, who judges according to his will. For this is the difference between the judge and the king, the judge being more subservient to the justice of the Torah than the king. It is for this reason that the king was exhorted and commanded to have a second Torah scroll with him (Deuteronomy 17:18-20): "And it shall be, when he sits upon his throne of kingdom, let him write for himself… and let it be with him… that his heart not raise itself above his brothers and that he not depart from the mitzvah…" That is, because the king sees that he is not so subservient to the laws of the Torah as the judge he requires additional exhortation not to depart from the mitzvah right or left and not to vaunt himself above his brothers because of the great powers given him by the Blessed One. But the judge does not need all of these exhortations because his powers are confined to the judgments of the Torah alone, as written: "and let him judge the people a righteous judgment," and he was already exhorted not to turn from these judgments in any way whatsoever, viz. (Ibid 16:19): "Do not pervert judgment."
(א) כי תבוא אל הארץ. עשה מצוה האמורה בענין, שבשכרה תכנס לארץ.
(ב) אשר ה' א-להיך נותן לך. בזכותך.
(ג) וירשתה וישבתה בה. בשכר שתירש תשב.
(ד) ואמרת אשימה עלי מלך ככל וגו'. (סנהדרין נב) ר' נהוראי אומר, ה בגנאי ישראל הוא מדבר, שנאמר (שמואל א ח) כי לא אותך מאסו, כי אותי מאסו ממלוך עליהם.
(ה) אמר ר' יהודה, והלא מצוה היא מן התורה לשאול להם מלך, שנאמר שום תשים עליך מלך אשר יבחר ה' א-להיך בו, ולמה נענשו בימי שמואל? מפני שהקדימו על ידם.
(ו) ככל הגוים אשר סביבותי. ר' נהוראי אומר, לא בקשו להם מלך אלא להעבידם עבודת כוכבים, שנא' (שמואל א ח) והיינו גם אנחנו ככל הגוים ושפטנו מלכנו ויצא לפנינו ונלחם את מלחמותינו.
(1) (Devarim 17:14) "When you come to the land": Do the mitzvah prescribed herein, in reward of which you will enter the land.
(2) "which the L-rd your G-d gives to you": in your merit.
(3) "and you inherit it and you inhabit it": As a reward for inheriting it, you will inhabit it.
(4) "and you say: I shall place over myself a king, as all the nations that are around me": R. Nehorai says: This verse speaks in denigration of Israel, as in (I Samuel 8:7) "For it is not you (Samuel) that they have rejected (in asking for a king), but it is Me whom they have rejected from reigning over them."
(5) R. Yehudah said: Is it not a mitzvah of the Torah to ask for a king? viz. (Ibid. 15) "Place shall you place over yourself a king, whom the L-rd your G-d shall choose"? Why, then, was Israel punished for this in the days of Samuel? — Because they (the "ignoramuses" of that generation) preempted them (the elders) by placing "like all the nations that are around us" (before "to judge us").
(6) R. Nehorai said: They sought a king only to lead them to idolatry, as it is written (I Samuel, Ibid. 20) "And we, too, will be like all the nations, and our king will judge us and go out before us, and fight our wars."
The appointment of a king was completely our decision, and G-d knew we were going to make it. (For a discussion of free will vs. G-d knowing the future, ask a competent Rav as opposed to a high school senior). He, therefore, set the ground rules and foundation so we know what G-d wants from us when this inevitably happens. It was not a problem that we asked for a king, rather why we asked for one. By saying we wanted to be like other nations, it was not l'shem mitzvah, and the fact that he was to lead us into battle meant we weren't placing our complete faith in G-d. That's why G-d told Shmuel that they weren't rejecting him, rather they were rejecting Hashem.
Oftentimes, we think that people can do better than Hashem, and it ultimately leads to our downfalls. We see by Yosef that he was stuck in jail for 2 more years because he put his faith in the sar hamashkim and not in Hashem completely. We should all be humbled enough to realize this. Sometimes, it takes a major catastrophe to realize this. Hopefully we realize before tragedy strikes.
AISHES YIFAS TO'AR- TAKING A CAPTIVE WOMAN AS A WIFE
(א) והיה אם לא חפצת בה. הכתוב מבשרך שאתה עתיד לשנאותה.
(1) (Devarim, Ibid. 14) "And it shall be, when you do not desire her": Scripture apprises you that you are destined to hate her.
(א) כִּי תֵצֵא לַמִּלְחָמָה. שָׁנוּ רַבּוֹתֵינוּ, מִצְוָה גּוֹרֶרֶת מִצְוָה, וַעֲבֵרָה גּוֹרֶרֶת עֲבֵרָה. וְרָאִיתָ בַּשִּׁבְיָה וְגוֹ', וְגִלְּחָה אֶת רֹאשָׁהּ וְעָשְׂתָה אֶת צִפָּרְנֶיהָ, כְּדֵי שֶׁלֹּא תִּמְצָא חֵן בְּעֵינֶיךָ. מַה כְּתִיב בַּתְרֵיהּ, כִּי תִהְיֶיןָ לְאִישׁ שְׁתֵּי נָשִׁים וְגוֹ'. שְׁתַּיִם בַּבַּיִת, מְרִיבָה בַּבַּיִת. וְלֹא עוֹד, אַחַת אֲהוּבָה וְאַחַת שְׂנוּאָה, אוֹ שְׁתֵּיהֶן שְׂנוּאוֹת. מַה כְּתִיב אַחֲרָיו, כִּי יִהְיֶה לְאִישׁ בֵּן סוֹרֵר וּמוֹרֶה. כָּל מָאן דְּנָסִיב יְפַת תֹּאַר, נָפִיק מִנַיְיהוּ בֵּן סוֹרֵר וּמוֹרֶה. שֶׁכֵּן כָּתַב בְּדָוִד, עַל שֶׁחָמַד מַעֲכָה בַּת תַּלְמַי מֶלֶךְ גְּשׁוּר בְּצֵאתוֹ לַמִּלְחָמָה, יָצָא מִמֶּנּוּ אַבְשָׁלוֹם שֶׁבִּקֵּשׁ לְהָרְגוֹ, וְשָׁכַב עִם עֶשֶׂר פִּלַגְשָׁיו לְעֵינֵי כָּל יִשְׂרָאֵל וּלְעֵינֵי הַשֶּׁמֶשׁ, וְעַל יָדוֹ נֶהֶרְגוּ מִיִּשְׂרָאֵל כַּמָּה רְבָבוֹת, וְעָשָׂה מַחֲלֹקֶת בְּיִשְׂרָאֵל, וְנֶהֱרַג שִׁמְעִי בֶּן גֵּרָא וְשֶׁבַע בֶּן בִּכְרִי וַאֲחִיתֹפֶל, וְלִמְפִיבֹשֶׁת (וּלְאִיֹש בֹּשֶת) הָרַג, וְהִשְׁלִיט צִיבָא עַל כָּל בֵּית שָׁאוּל. וְתַנְיָא, רַבִּי יוֹסִי אוֹמֵר, וְכִי מִפְּנֵי שֶׁאָכַל בֵּן סוֹרֵר וּמוֹרֶה חֲצִי לִיטְרָא בָּשָׂר וְשָׁתָה חֲצִי לוֹג יַיִן חַי אָמְרָה תּוֹרָה יֵצֵא לְבֵית דִּין וְיִסָּקֵל. אֶלָּא הִגִּיעָה תּוֹרָה לְסוֹף דַּעְתּוֹ שֶׁל בֶּן סוֹרֵר וּמוֹרֶה, שֶׁסּוֹפוֹ לִגְמֹר נִכְסֵי אָבִיו עִם הַסְּרִיקִין שֶׁאָכַל וְשָׁתָה עִמָּהֶן, וּמְבַקֵּשׁ לִמּוּדוֹ וְאֵינוֹ מוֹצֵא, וְיָצָא לְפָרָשַׁת דְּרָכִים וְהוֹרֵג וּמְלַסְטֵם אֶת הַבְּרִיּוֹת, וְאָמְרָה תּוֹרָה, יָמוּת זַכַּאי וְאַל יָמוּת חַיָּיב, שֶׁמִּיתָתָן שֶׁל רְשָׁעִים, הֲנָאָה לָהֶם וַהֲנָאָה לָעוֹלָם. בֶּן סוֹרֵר וּמוֹרֶה, כְּתִיב אַחֲרָיו, כִּי יִהְיֶה בְאִישׁ חֵטְא מִשְׁפַּט מָוֶת וְהוּמָת. אִם נִצָּל מִזּוֹ, לֹא נִצָּל מִזּוֹ. לָמַדְנוּ, שֶׁעֲבֵרָה גּוֹרֶרֶת עֲבֵרָה. וּמִצְוָה גּוֹרֶרֶת מִצְוָה, מִנַּיִן. דִּכְתִיב: כִּי יִקָּרֵא קַן צִפּוֹר לְפָנֶיךָ, שַׁלֵּחַ תְּשַׁלַּח וְגוֹ' לְמַעַן יִיטַב לָךְ וְהַאֲרַכְתָּ יָמִים. אַחֲרָיו מַה כְּתִיב: כִּי תִּבְנֶה בַּיִת חָדָשׁ, תִּזְכֶּה לִבְנוֹת בַּיִת חָדָשׁ וְלַעֲשׂוֹת מַעֲקֶה. מַה כְּתִיב אַחֲרָיו, לֹא תִזְרַע כַּרְמְךָ כִּלְאָיִם, תִּזְכֶּה לְכֶרֶם וְלִזְרֹעַ שָׂדֶה. מַה כְּתִיב אַחֲרָיו, לֹא תַּחֲרֹשׁ בְּשׁוֹר וּבַחֲמוֹר, תִּזְכֶּה לִשְׁוָרִים וַחֲמוֹרִים. מַה כְּתִיב אַחֲרָיו, לֹא תִלְבַּשׁ שַׁעַטְנֵז, תִּזְכֶּה לִבְגָדִים נָאִים מִן צֶמֶר וְלִבְגָדִים נָאִים מִפִּשְׁתִּים. מַה כְּתִיב אַחֲרָיו, גְּדִלִים תַּעֲשֶׂה לָךְ, תִּזְכֶּה לְמִצְוַת צִיצִית. מַה כְּתִיב אַחֲרָיו, כִּי יִקַּח אִישׁ אִשָּׁה, תִּזְכֶּה לְאִשָּׁה וּלְבָנִים. הֲרֵי לָמַדְנוּ, שֶׁמִּצְוָה גּוֹרֶרֶת מִצְוָה, וַעֲבֵרָה גּוֹרֶרֶת עֲבֵרָה. לְפִיכָךְ נִסְמְכוּ פָּרָשִׁיּוֹת אֵלּוּ זוֹ לָזוֹ.