Shimon and Levi.... accursed is their wrath.... I shall divide them among Yaacov and I shall disperse them in Israel. (Beraishis 49:5-7)
The fact that Shimon and Levi had no share in the land is here demonstrated to be a punishment. But we see later on, "In the midst of the sons of Israel they (the Levites) shall not have an estate. Because the maaser of the sons of Israel.... I have given to the Levites as an estate," (Bamidbar 18:24-25).
Also: "There shall not be to.... the entire tribe of Levi any share or inheritance with Israel.... Hashem is his estate," (Devarim 18:1-2). Thus the tribe of Levi proved worthy of changing the punishment into a reward and a privilege.
A prophecy may be fulfilled in a variety of ways...
These verses therefore constitute a great admonition against the sin of anger
Hashem interprets His prophecies and fulfills them in accordance with what men deserve. By their behavior, men are able to cause the fulfillment of the prophecy in one of a variety of interpretations. Because of Levi’s deeds at the time of the Golden Calf, the prophecy of landlessness (a curse in 49:5-7) became a blessing: "Hashem is his estate," (Devarim 18:2). Thus Yaakov’s curse was a blessing (see 49:28).
The fact that this curse is inscribed in the Torah at all is a monumental testimony to the truthfulness of the Torah. Levi was the progenitor of the tribe of the most loyal adherents of the Torah. They were also the especial guardians of the Torah writings. The curse of Yaacov would not have been inscribed and would not have been allowed to remain in the Torah had it not been dictated by the word of G-d to Moshe. Thus it stands forever as a supreme monument to the truth of G-d’s Torah.
They caused no harm, yet because they may have brought the people of Canaan to war against them as Yaacov had feared (34:30), they were severely rebuked and were deprived of a share in the land. Thus we learn that one who endangers another, even if he is performing a virtuous act and even if no harm resulted from his act, yet he is held severely accountable in the eyes of Hashem.
This curse was pronounced not on Shimon and Levi, because the people of Israel are "the blessed people," and are never cursed. The curse is upon the trait of wrathfulness itself, especially when it is exercised without regard for the consequences. These verses therefore constitute a great admonition against the sin of anger, and they are a Torah lesson of the necessity to be always mindful of the consequences. We see here in the Torah a powerful admonition against yielding to anger. — The Beginning