"And Aaron saw, and he built an altar before it" (Exodus 32:5). What did he see? He saw Hur slaughtered before him. He said: If I do not listen to them, they will do to me as they did to Hur, and there will be fulfilled regarding them the verse "Shall priest and prophet be slain in the sanctuary of the LORD?" (Lamentations 2:20), and they will have no remedy ever. Better that they make a calf; it is possible that they will yet have a remedy through repentance.
Aaron Saw Hur Slaughtered and Built an Altar
Yalkut Shimoni on Torah 391:9
וַיַּרְא אַהֲרֹן וַיִּבֶן מִזְבֵּחַ לְפָנָיו. מֶה רָאָה. רָאָה חוּר זָבוּחַ לְפָנָיו. אָמַר, אִי לָא שְׁמַעְנָא לְהוּ עָבְדִין לִי כְּחוּר וּמִקָּיֵם בְּהוּ (איכה ב, כ) "אִם יֵהָרֵג בְּמִקְדַּשׁ ה' כֹּהֵן וְנָבִיא" וְלָא הָוְיָא לְהוּ תַּקָּנְתָא לְעוֹלָם, מוּטָב לֵיעָבְדוּ עֵגֶל, אֶפְשָׁר דַּהֲוֵי לְהוּ תַּקָּנְתָא בִּתְשׁוּבָה.