Why did Moses break the tablets?

(יד) וַיִּנָּ֖חֶם יְהוָ֑ה עַל־הָ֣רָעָ֔ה אֲשֶׁ֥ר דִּבֶּ֖ר לַעֲשׂ֥וֹת לְעַמּֽוֹ׃ (פ) (טו) וַיִּ֜פֶן וַיֵּ֤רֶד מֹשֶׁה֙ מִן־הָהָ֔ר וּשְׁנֵ֛י לֻחֹ֥ת הָעֵדֻ֖ת בְּיָד֑וֹ לֻחֹ֗ת כְּתֻבִים֙ מִשְּׁנֵ֣י עֶבְרֵיהֶ֔ם מִזֶּ֥ה וּמִזֶּ֖ה הֵ֥ם כְּתֻבִֽים׃ (טז) וְהַ֨לֻּחֹ֔ת מַעֲשֵׂ֥ה אֱלֹהִ֖ים הֵ֑מָּה וְהַמִּכְתָּ֗ב מִכְתַּ֤ב אֱלֹהִים֙ ה֔וּא חָר֖וּת עַל־הַלֻּחֹֽת׃ ׃ (יט) וַֽיְהִ֗י כַּאֲשֶׁ֤ר קָרַב֙ אֶל־הַֽמַּחֲנֶ֔ה וַיַּ֥רְא אֶת־הָעֵ֖גֶל וּמְחֹלֹ֑ת וַיִּֽחַר־אַ֣ף מֹשֶׁ֗ה וַיַּשְׁלֵ֤ךְ מידו [מִיָּדָיו֙] אֶת־הַלֻּחֹ֔ת וַיְשַׁבֵּ֥ר אֹתָ֖ם תַּ֥חַת הָהָֽר׃

(14) And the LORD renounced the punishment He had planned to bring upon His people. (15) Thereupon Moses turned and went down from the mountain bearing the two tablets of the Pact, tablets inscribed on both their surfaces: they were inscribed on the one side and on the other. (16) The tablets were God’s work, and the writing was God’s writing, incised upon the tablets. (19) As soon as Moses came near the camp and saw the calf and the dancing, he became enraged; and he hurled the tablets from his hands and shattered them at the foot of the mountain.

וא"ר (אליעזר) מאי דכתיב (שמות לב, טז) חרות על הלוחות אלמלי לא נשתברו לוחות הראשונות לא נשתכחה תורה מישראל רב אחא בר יעקב אמר אין כל אומה ולשון שולטת בהן שנאמר חרות אל תיקרי חרות אלא חירות

And, lastly, Rabbi Eliezer said: What is the meaning of that which is written: “And the tablets were the work of God, and the writing was the writing of God, engraved upon the tablets” (Exodus 32:16)? This teaches that had the first tablets, the subject of this verse, not been broken, the Torah would never have been forgotten from the Jewish people, as the Torah would have been engraved upon their hearts. Rav Aḥa bar Ya’akov said: Had the tablets not been broken, no nation or tongue would ever have ruled over them, as it is stated: “Engraved”; do not read it engraved [ḥarut] but rather freedom [ḥeirut].

רמב"ן על שמות ל״ב:ט״ז

לא נמנע משה בכל זה מלשבר אותם, כי חרה לו בראותו המעשה הרע ההוא, ולא יכול להתאפק

Ramban on Exodus 32:16

Nevertheless, Moshe did not prevent himself from breaking the luchot for he was enraged upon seeing this evil spectacle, and he could not bear it.

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

Pirkei D'Rebbe Eliezer

Moshe took the luchot and went down (the mountain), and the letters were carrying themselves and Moshe... and when the (letters) saw the instruments and the golden calf, they flew off the tablets, and they became heavy. Moshe could no longer carry them, so he threw them out of his hands, as it says, "and he broke them under the mountain."

שבר את הלוחות מאי דריש אמר ומה פסח שהוא אחד מתרי"ג מצות אמרה תורה (שמות יב, מג) וכל בן נכר לא יאכל בו התורה כולה [כאן] וישראל מומרים על אחת כמה וכמה ומנלן דהסכים הקב"ה על ידו שנאמר (שמות לד, א) אשר שברת ואמר ר"ל יישר כחך ששיברת

And he broke the tablets following the sin of the Golden Calf. What source did he interpret that led him to do so? Moses said: With regard to the Paschal lamb, which is only one of six hundred and thirteen mitzvot, the Torah stated: “And the Lord said unto Moses and Aaron: This is the ordinance of the Paschal offering; no alien shall eat of it” (Exodus 12:43), referring not only to gentiles, but to apostate Jews as well. Regarding the tablets, which represented the entire Torah, and Israel at that moment were apostates, as they were worshipping the calf, all the more so are they not worthy of receiving the Torah. And from where do we derive that the Holy One, Blessed be He, agreed with his reasoning? As it is stated: “The first tablets which you broke [asher shibarta]” (Exodus 34:1), and Reish Lakish said: The word asher is an allusion to the phrase: May your strength be true [yishar koḥakha] due to the fact that you broke the tablets.

Exodus Rabbah 41:1

Moses broke the tablets in order to discourage G‑d from implementing His plan to annihilate the Jewish people for their sin, and to recreate a new chosen nation from Moses and his descendants (see Exodus 32:10). Upon breaking the tablets, he told G‑d, “Now I am a sinner just like them. If You decide to eradicate them, destroy me as well.