The Reasons for the Mitzvot, part one

דברים פרק ד
ה) רְאֵה לִמַּדְתִּי אֶתְכֶם חֻקִּים וּמִשְׁפָּטִים כַּאֲשֶׁר צִוַּנִי יְקֹוָק אֱלֹהָי לַעֲשׂוֹת כֵּן בְּקֶרֶב הָאָרֶץ אֲשֶׁר אַתֶּם בָּאִים שָׁמָּה לְרִשְׁתָּהּ:
ו) וּשְׁמַרְתֶּם וַעֲשִׂיתֶם כִּי הִוא חָכְמַתְכֶם וּבִינַתְכֶם לְעֵינֵי הָעַמִּים אֲשֶׁר יִשְׁמְעוּן אֵת כָּל הַחֻקִּים הָאֵלֶּה וְאָמְרוּ רַק עַם חָכָם וְנָבוֹן הַגּוֹי הַגָּדוֹל הַזֶּה:

Behold I have taught you statutes and ordinances to perform in the midst of the land which you are coming to inherit. Be careful and do them because this is your wisdom and understanding in the eyes of the nations who will hear of all of these statutes and say "What a great nation this is." (Deuteronomy 4:5-6)

************************************************************************************

רמב"ן דברים פרק ד
(ה) וטעם ראה למדתי אתכם - ראה שאני מלמד אתכם היום, כמו שאמר אשר אנכי מצוה אתכם היום (להלן יא יג) ואשר אנכי נותן לפניכם היום (בפסוק ח). או יאמר "למדתי", מפני שהזכיר "לעשות כן בקרב הארץ", כלומר ראה בעת בואך לארץ שלמדתי אתכם חקים ומשפטים כאשר צוני ה' אלהי. והנה מתחלה דבר על הדבר שהיא כלל לכל עשה ולא תעשה, ועתה יזהיר בחוקים שהם גזרותיו ובמשפטים שהם הדינים, כי אלו הם צריכין חזוק יותר, מפני העלם טעם החקים, ומפני כי במשפט יעמידו ארץ. ואמר לעשות כן בקרב הארץ - להזהיר על כולם, כי יש חוקים רבים ומשפטים שאינן נוהגין בחוצה לארץ. או ירמוז שעיקר המצות כולן בארץ כמו שרמזתי בסוד הארץ (ויקרא יח כה)

ואמר כי בחוקים ובמשפטים תועלות גדולות, שהם תפארת לעושיהם מן האדם, ואפילו שונאיהם ישבחו אותם בהם. ועוד שהם תועלת גדולה שאין כמותה שהשם יהיה קרוב להם בכל קראם אליו, וכן העמים יתבוננו בזה ידעו כי החוקים נעשים בחכמה ובינה לקרבה אל האלהים וייראו מהם, וזהו שאמר כי מי גוי גדול - ועוד שהחוקים והמשפטים בעצמם הם צדיקים, ישרים וטובים בישוב העם והמדינות

Nachmanides:

And it says these statutes and ordinances have great value, because these are the adornment for who those do them, and even their enemies will praise them for this. Moreover, they have great value since there is nothing comparable to show that G-d is close to them in his reaching out to them. And the nations will reflect upon this and know that these statutes are done with wisdom and understanding to bring (Israel) close to G-d and to be careful in their observance, and this is what is meant by the passage: " What great nation…"and further that these statutes and ordinances themselves are righteous, straight and good for the security of the lives of the nation (of Israel) and of the other nations.

*************************************************************************

Rambam

Maimonides:
And Scripture says, That, when they hear all these statutes, shall say: Surely this great nation is a wise and understanding people (Deut. 4:6)_. Thus it states explicitly that even all the statutes will show to all the nations that they have been given with wisdom and understanding. Now if there is a thing for which no reason is known and that does not either procure something useful or ward off something harmful, why should one say of one who believes in it or practices it that he is wise and understanding and of great worth? And why should the religious communities thank it is a wonder? Rather things are indubitably as we have mentioned: every commandment from among these 613 commandments exists either with a view to communicating a correct opinion, or to putting an end to an unhealthy opinion, or to communicating a rule of justice, or to warding off an injustice or to endowing men with a noble moral quality, or to warning them against an evil moral quality. Thus (all the commandments) are bound up with three things: opinions, moral qualities, and political civic actions.
(Rambam, Guide to the Perplexed, Part III, Chapter 31. )

****************************************************************

Rabbi Isidore Twersky on this passage of the Rambam:

Hukkim are messages which must be deciphered and decoded; they appear undecipherable only for lack of knowledge, insight, and sensitivity. There may be setbacks along the road , and one may reach impasses in analysis, but the cumulative trouble and frustration should not discourage the inquirer. In sum, the Torah has stated unequivocally that statutes are purposive and must be properly interpreted, temporary confusion and uncertainties notwithstanding. This passage insists, furthermore, that the interpretation must be of such a nature that it will have a universal resonance and impress all the nations. It is not merely another Scriptural proof but it provides basic directives for the unfolding of the entire intellectual enterprise. The reasons must be univerally intelligible and persuasive.

(R. Isidore Twersky, Introduction to the Code of Maimonides, p. 385-386)