God seems very angry with, and punishes the builders of the tower of Bavel, but it is not clear exactly what their sin was. Did they violate one of the 7 mitzvos b'nei Noach? What exactly was their sin?
The Rasa"g (probably based on the simple reading of Perek 11, Passuk 4) explains that their sin was that they wanted to stay in one singular area and not filling the earth as Hashem commanded them earlier, which led Him to disperse them (see passuk 8). This is quoted in the book of R. Adin Steinsaltz titled פירוש המקרא בספרות השאלות והתשובות. The 1978 edition has an online source available here.
Sforno suggests that we begin by understanding the motivations of these people. Why did they wish to create a single monolithic society? Sforno seems to say that the objective was to empower a single ruler over all of humanity. This would be accomplished through two steps.
- A great capital city would be built.
- The people would share a single religion, culture and language.
Sforno explains that Hashem opposed the creation of a universal form of idolatry. The pervasiveness of the shared religious beliefs discourages any individual from seeking an alternative theology. This is for two reasons.
- The psychological pressure to conform to a universal theology would be tremendous.
- Anyone challenging a universal set of beliefs would be a pariah and could not hope to find refuge anywhere. He would be hunted down and destroyed.
These factors precluded the development of a person like Avraham who would seek the truth.
In contrast, the existence of multiple religions contributes in finding Hashem. First, in a world with multiple religions, it is natural for a person to question the credibility of the various perspectives. Second, the development of multiple cultures and societies would provide the opportunity for a dissenter to find refuge. When rejected from one society, he could find refuge elsewhere. In short, the Haflagah contributed to the development of Avraham. As a result of these considerations, Hashem caused the Dispersion. This, in turn, produced a variety of cultures and religions.
ספורנו עה"ת ספר בראשית פרק יא פסוק ד (ד) ויאמרו הבה נבנה לנו עיר. זאת הית' עצת שרי הדור להמליך את נמרוד על כל המין האנושי: ומגדל וראשו בשמים ונעשה לנו שם. נעשה שם שתהיה במגדל ויצא בכל המין האנושי שם גובה מקומה וגודל עירה באופן שתחשב אלהי האלהים אצל כל בני האדם ואליה ידרשו כלם. והכונה בזה היתה שהמלך על אותה העיר ימלוך על כל המין האנושי בהיות שם דרישת כלם:
ספורנו עה"ת ספר בראשית פרק יא פסוק ו (ו) הן עם אחד. כי אמנם הבטול המפר עצות ומניא מחשבות הוא המחלוקת הקורה אם לסבת הדתות ואם לסבת הלשונות. והנה אלה היו עם אחד בענין הדת כי היו כלם מסכימים בדעת אנשי הצא"בה ועם זה היה כלם מסכימים בלשון: וזה החלם לעשות. וגם כן נמצאה לכלם עתה זאת ההתחלה שעשו בהסכמת כלם: ועתה לא יבצר מהם. אם כן אין מונע להם מהשלים כונתם ותהיה אותה עו"ג אשר יבחרו כללית לכל מין האדם ולא יפנה אחד מהם לדעת את הבורא ית' ולהבין כי יוצר הכל הוא. והפוך זה יקרה כשתהיה מחלוקת בענין האלהות כי כל אחד יחשוב שיש אלהי האלהים שכל האלוהות מסכימי' לדעתו ובו ישלם סדרם וסדר המציאו' כאמרו כי ממזרח שמש ועד מבואו גדול שמו בגוים:
Ralbag suggests a fascinating approach to understanding the incident. He explains that these people did not sin in any way. They were not dispersed as a punishment. Instead, they were dispersed in order to assure the preservation of humanity. Concentration of the entire human race in a single location created the possibility of sudden extinction. A localized natural disaster could destroy the entire species. Through dispersing humanity the impact of a localized natural disaster was diminished. Should a specific location experience a devastating disaster, only a portion of humanity would be destroyed. The remainder would survive. Ralbag makes another important point. He discusses the manner in which the Dispersion was brought about. Hashem awakened in families the desire to differentiate themselves. This led to the establishment of different customs and eventually completely unique languages.
See רלבג עה"ת ספר בראשית פרק יא פסוקים ב-ט
Talmud (Sandhedrin 109a):
In the School of Rabbi Shila it was taught that they built the tower with the intention of piercing the heavens with axes to drain all the water held therein, making it impossible for G‑d to bring another flood, should they vex Him again. (Perhaps what's meant by this is that they had embraced their understanding of science and its workings to the extent that they felt they were now able to spar with G‑d on His turf—the heavens.)
Rabbi Yirmiya bar Elazar taught that there were actually three groups; each with its own plans for the tower: One group planned to climb the tower, safely out of harm's way, should another flood come. A second camp wanted to use it as a shrine for idol worship. Yet a third group actually wanted to use it as a platform from which to battle G‑d.
Rabbi Natan, on the other hand, taught that all of them intended to serve idols.
Targum Yonasan indicates that they intended to put an Avoda Zara at the top of the tower.
סגדו ברישיה which is translated by Peirush Yonasan as בראש מגדל השתחויה לע"ז
The first Mitzva of Bnei Noach is no Avodah Zara.
Ramban Breishis 11:2 says that they were קוצצים בנטיעות which is explained as כפירה מוחלטת absolute Kfira.
I saw in a certain sefer (I don't remember the name) that they wanted to commit various types of sin like the generation of the flood, but could not do so because if they did Hashem would bring upon them a flood. (Commentaries elsewhere have explained that Hashem's promise not to bring a flood meant not to flood the whole world, but He still might flood a single place. Therefore, since they had now all gathered in one place they had a problem.)
Their solution was to build a very high tower to the heavens (ie above the height of the mountains) with an external staircase so that the entrance was on top of the tower, and this way they could sin with impunity since a flood would not affect them.
This is what the posuk means "and now (if they succeed in building this tower) nothing will be withheld from them what they plan to do (they could sin freely)".
Rabbi Uziel Milevsky, former chief rabbi of mexico discusses this in a lecture.
He first asks if the purpose is to build a tower to reach heaven as the verse says, then why would they build it in a valley? Obviously they should have built it on a mountain.
He then explains that it was some kind of symbol of rebellion against G-d. "we will remove God from heaven". We don't need to be subservient to God. We will control the world. similar to the scientific community today.
The leader of that rebellion was called Nimrod which comes from the word "rebel". see there for more.