Rashi writes (Bamidbar 19:2) that Hashem declared the mitzvah of parah adumah to be a “chok” – Divine decree with no readily apparent rationale – regarding which we are not permitted to inquire or attempt to understand. Shlomo Hamelech declared (Bamidbar Rabbah 19:3) that after using all of his intellectual capabilities to attempt to understand this mitzvah, he was still unable to do so.
Yet Rashi also writes in the name of Rav Moshe HaDarshan that the parah adumah served as atonement for the sin of the golden calf, and he proceeds to explain how each detail of its laws specifically atoned for a corresponding aspect of the golden calf. After writing that the parah adumah is the quintessential chok, the purpose of which even Shlomo couldn’t grasp, how can Rashi proceed to explain the rationale behind the mitzvah in great detail? Secondly, in what way did this mitzvah specifically effect atonement for the golden calf?
The Beis HaLevi explains that when the Jews incorrectly concluded that Moshe died, they were distraught by the lack of an intermediary to lead them and teach them Hashem’s will. They yearned to build a place for the Divine presence to rest among them to fill the void left by Moshe’s perceived death. Because their intentions in building the calf were for the sake of Heaven, they selected Aharon to lead the project so that it would succeed. If so, what was their mistake, and why did their plans go so awry?
The Beis HaLevi explains that each mitzvah contains within it deep, mystical secrets which have tremendous effects in the upper worlds when performed properly. At Mount Sinai, the Jewish people erred in thinking that if they discovered the Kabbalistic concepts behind a mitzvah, they could perform it based on their understanding even without being commanded. As a result, although their intentions were proper, they lacked the Divine assistance which comes only from performing His will, and they ended up sinning with the golden calf.
The Medrash (Shemos Rabbah 51:8) teaches that the Mishkan also served as atonement for the golden calf. The Beis HaLevi explains that because the sin of the golden calf was caused by doing something without a command from Hashem to do so, the Torah repeatedly emphasizes in Parshas Pekudei (e.g. 39:5) that every aspect of the Mishkan was made exactly as Hashem commanded Moshe.
With this introduction, we can answer our original questions. The mitzvah of parah adumah is indeed a chok, the logic of which escaped Shlomo and certainly Rav Moshe HaDarshan. If so, what does he mean when he says that the red heifer comes to atone for the golden calf? As we now understand that the root of the sin of the golden calf was the Jews’ attempt to “outsmart” Hashem by doing something which He didn’t command them to, the ultimate rectification of this sin is to completely subordinate one’s intellect to Hashem’s dictates. This was manifested by their willingness to perform a chok, a mitzvah which appears to make no sense but which we do solely because Hashem commanded it.(taken from Parsha Potpourri by R' Oizer Alport)