The Gemara (שבת פח.) relates that when the Yidden were offered the Torah, and answered נַעֲשֶׂה וְנִשְׁמָע, Hashem said מִי גִילָה רָז זֶה לְבָנַי, who revealed this secret to my children. This is what the מַלְאֲכֵי הַשָּׁרֵת do. They declare their readiness to do all which I command, even before they hear the exact mission. Who revealed this angelic response to my children? The Panim Yafos continues by stating that a person should delve into the reasons for every one of Hashem's dictates, but his primary motive should always be to do רָצוֹן ה'.
The ideal way of doing Avodas Hashem should be to do each mitzvah initially as a חֹק, with the sole intention of fulfilling Hashem's command, and thereafter we can learn about the reasons and perform it as a mishpat. The עֲשִׂיָּה should never be contingent on the טַעַם.
He quotes a verse in Tehillim (קמז יט) מַגִּיד דְּבָרָיו לְיַעֲקֹב חֻקָּיו וּמִשְׁפָּטָיו לְיִשְׂרָאֵל. Hashem gave Yisroel both chukim, and mishpatim. We should perform the mitzvos as chukim, regardless of the reasons, with the sole intent of doing rotzon Hashem. Separately, we should also learn the reasons for the mitzvos, especially where the Torah delves into them, however this should have no connection with the performance thereof.