"How goodly are your tents, O Jacob" (Numbers 24:5). He saw that the entrances of Israel were not aligned one opposite the other, but each entrance was opened away from the tent of its neighbor, so that none of them would gaze into the dwelling of his fellow. He began to cast an evil eye upon them; and therefore he began to praise them, so that the evil eye should not have power over them; and therefore his eye was stopped up. Another interpretation: "How goodly are your tents" — by the merit that Jacob dwelt in them, as it is said, "And Jacob was a plain man, dwelling in tents" (Genesis 25:27); and on account of this Israel merited to dwell in tents in the wilderness. "Your dwelling-places, O Israel" — he spoke of the Tabernacle and of the Temple that Israel made, in which the Shekhinah dwelt, and it was what protected them.
Why Balaam Blessed Israel's Tents and Dwelling-Places
Midrash Aggadah, Numbers 24:5
מה טבו אהליך יעקב. ראה שלא היו פתחיהן של ישראל מכוונים זה לזה, אלא כל פתח הי' פתוח אחרי אהל חבירו, כדי שלא יסתכל כל אחד ואחד מהם בביתו של חבירו, התחיל להכניס להם עין רעה, ולכך התחיל לשבחם כדי שלא תשלוט בהם עין רעה, ולכך נסתמו עינו: ד"א מה טבו אהליך. בזכות שישב יעקב בהם, שנאמר ויעקב איש תם יושב אוהלים (בראשית כ"ה כ"ז), ועל זה זכו ישראל לישב באוהלים במדבר: משכנותיך ישראל. אמר על המשכן ועל המקדש שעשו ישראל שהשכינה שכנה בהם והוא היה מצילם: