Which came first the Golden Calf or the Mishkan?
(ח) וְעָ֥שׂוּ לִ֖י מִקְדָּ֑שׁ וְשָׁכַנְתִּ֖י בְּתוֹכָֽם׃

(8) And let them make Me a Sanctuary, that I may dwell among them.

The Golden Calf Came First

(יח) ויתן אל משה וגו'. אֵין מֻקְדָּם וּמְאֹחָר בַּתּוֹרָה – מַעֲשֶׂה הָעֵגֶל קוֹדֶם לְצִוּוּי מְלֶאכֶת הַמִּשְׁכָּן יָמִים רַבִּים הָיָה – שֶׁהֲרֵי בְי"ז בְּתַמּוּז נִשְׁתַּבְּרוּ הַלֻּחוֹת, וּבְיוֹם הַכִּפּוּרִים נִתְרַצָּה הַקָּבָּ"ה לְיִשְׂרָאֵל, וּלְמָחֳרָת הִתְחִילוּ בְנִדְבַת הַמִּשְׁכָּן וְהוּקַם בְּאֶחָד בְּנִיסָן:

(18) ויתן אל משה וגו׳ And he gave Moses the two tablets... — There is no “earlier” or “later” (no chronological order) in the events related in the Torah: in fact the incident of the golden calf (related in ch. 31) happened a considerable time before the command regarding the work of the Tabernacle was given (ch. 25 and the following chapters). For on the 17th of Tammuz the first Tablets were broken (when the people were worshipping the calf) and then on Yom Kippur God finally forgave Israel (after Moses had prayed 80 days for forgiveness; therefore it is very unlikely that the command for the building of the Tabernacle should have been given before that day).

(א) וְזֶ֨ה הַדָּבָ֜ר אֲשֶֽׁר־תַּעֲשֶׂ֥ה לָהֶ֛ם לְקַדֵּ֥שׁ אֹתָ֖ם לְכַהֵ֣ן לִ֑י לְ֠קַח פַּ֣ר אֶחָ֧ד בֶּן־בָּקָ֛ר וְאֵילִ֥ם שְׁנַ֖יִם תְּמִימִֽם׃

(1) And this is the thing that you shall do to (Aaron and his sons) to hallow them to minister to Me in the priest’s office: take one young bullock and two rams without blemish...

(ב) פר אחד. לְכַפֵּר עַל מַעֲשֵׂה הָעֵגֶל שֶׁהוּא פָּר.

(2) פר אחד ONE BULLOCK — to atone for the incident of worshipping the golden calf which is of the bullock species

Midrash Tanhuma T'tzaveh 10

Aaron was scared that God might want to severely punish him. Therefore God told Moses to appoint Aaron to High Priest, so that he would know that God forgives him.

Midrash Tanhuma T'tzaveh 10

Why was Aaron instructed to sacrifice two Rams? This was to protect two of his sons for dying as punishment for the Golden Calf.

Rambam "The Guide of the Perplexed" Chapter 32 - See attached handout

The Mishkan Came First
(א) וַיַּקְהֵ֣ל מֹשֶׁ֗ה אֶֽת־כָּל־עֲדַ֛ת בְּנֵ֥י יִשְׂרָאֵ֖ל וַיֹּ֣אמֶר אֲלֵהֶ֑ם אֵ֚לֶּה הַדְּבָרִ֔ים אֲשֶׁר־צִוָּ֥ה יְהוָ֖ה לַעֲשֹׂ֥ת אֹתָֽם׃

(1) And Moses assembled all the congregation of the children of Israel, and said to them: ‘These are the words which the Lord has commanded, that you should do them (regarding the building of the Tabernacle).

Ramban on Exodus 35:1

Moses had been commanded of all this before the Golden Calf but the building plans had been put on hold, until the Israelites showed contrition for their sin. Seeing their remorse, God returned to God's pure love of the Israelites and decided to move forward with the building of the Tabernacle.

(ב) דַּבֵּר֙ אֶל־בְּנֵ֣י יִשְׂרָאֵ֔ל וְיִקְחוּ־לִ֖י תְּרוּמָ֑ה מֵאֵ֤ת כָּל־אִישׁ֙ אֲשֶׁ֣ר יִדְּבֶ֣נּוּ לִבּ֔וֹ תִּקְח֖וּ אֶת־תְּרוּמָתִֽי׃

(2) ’Speak to the children of Israel, that they take for Me an offering; of every person whose heart is inspired...

Ramban on Exodus 25:2

God had already revealed God's divine presence at Mount Sinai and established a covenant with the Israelites. God therefore felt that they were holy and worthy to build a Sanctuary through which God will make Divine Glory dwell among them. The main purpose of the Tabernacle is to contain a place in which the Divine Glory dwells.

(ב) נְקַדְּמָ֣ה פָנָ֣יו בְּתוֹדָ֑ה בִּ֝זְמִר֗וֹת נָרִ֥יעַֽ לֽוֹ׃
(2) Let us come before His presence with thanksgiving, Let us shout for joy unto Him with psalms.

Midrash Tehillim 95:2 - The offering of thanksgiving in the Temple did not serve as atonement. The only purpose of the thanksgiving offering was giving thanks.

The Precedent - God Instructs Humans in Reaction to Sin or Evil

(כא) וַיָּ֣רַח יְהוָה֮ אֶת־רֵ֣יחַ הַנִּיחֹחַ֒ וַיֹּ֨אמֶר יְהוָ֜ה אֶל־לִבּ֗וֹ לֹֽא־אֹ֠סִף לְקַלֵּ֨ל ע֤וֹד אֶת־הָֽאֲדָמָה֙ בַּעֲב֣וּר הָֽאָדָ֔ם כִּ֠י יֵ֣צֶר לֵ֧ב הָאָדָ֛ם רַ֖ע מִנְּעֻרָ֑יו וְלֹֽא־אֹסִ֥ף ע֛וֹד לְהַכּ֥וֹת אֶת־כָּל־חַ֖י כַּֽאֲשֶׁ֥ר עָשִֽׂיתִי׃

(21) ...and the LORD said in His heart: ‘I will not again curse the ground any more for human’s sake, for the imagination of man’s heart is evil from his youth; neither will I again smite any more every thing living, as I have done.

(א) וַיְבָ֣רֶךְ אֱלֹהִ֔ים אֶת־נֹ֖חַ וְאֶת־בָּנָ֑יו וַיֹּ֧אמֶר לָהֶ֛ם פְּר֥וּ וּרְב֖וּ וּמִלְא֥וּ אֶת־הָאָֽרֶץ׃ (ב) וּמוֹרַאֲכֶ֤ם וְחִתְּכֶם֙ יִֽהְיֶ֔ה עַ֚ל כָּל־חַיַּ֣ת הָאָ֔רֶץ וְעַ֖ל כָּל־ע֣וֹף הַשָּׁמָ֑יִם בְּכֹל֩ אֲשֶׁ֨ר תִּרְמֹ֧שׂ הָֽאֲדָמָ֛ה וּֽבְכָל־דְּגֵ֥י הַיָּ֖ם בְּיֶדְכֶ֥ם נִתָּֽנוּ׃ (ג) כָּל־רֶ֙מֶשׂ֙ אֲשֶׁ֣ר הוּא־חַ֔י לָכֶ֥ם יִהְיֶ֖ה לְאָכְלָ֑ה כְּיֶ֣רֶק עֵ֔שֶׂב נָתַ֥תִּי לָכֶ֖ם אֶת־כֹּֽל׃

(1) And God blessed Noah and his sons, and said to them: ‘Be fruitful and multiply, and replenish the earth. (2) And the fear of you and the dread of you shall be upon every beast of the earth, and upon every fowl of the air, and upon all wherewith the ground teemeth, and upon all the fishes of the sea: into your hand are they delivered. (3) Every moving thing that lives shall be for food for you; as the green herb have I given you all.