מה טובו אהליך יעקב. בתי מדרשות. כענין יושב אהלים וכענין וישכון באהלי שם וכן והיה כל מבקש ה' יצא אל אהל מועד: !מה טובו אהליך יעקב; a reference to the Torah academies. [the word אהל in that sense dates back to Genesis 25,27 where Yaakov is described as יושב אהלים a dweller in tents.” It was also used in this sense by Noach when he blessed his son Shem (Genesis 9,27) We find it even more prominently as possessing this meaning in Exodus 33,7 “anyone desirous of finding the presence of G’d would go out to the Tent of Testimony.”
משכנותיך. בתי כנסיות ומקדשי אל המיוחדים לשכן שמו שם ולקבל תפלת המתפללים. ואמר מה טובו כי לא בלבד הם מטיבים לעוסקים בם אבל מטיבים לכל האומה כמו שיורה שם יעקב שישאר בעקב ובאחרית הכל ולא יסוף וכמו שיורה שם ישראל לשרר עם אלהים ועם אנשים: משכנותיך, a reference to the synagogues of the Jews all over, as well as to their Temples when these existed. The reason that Bileam said מה טובו, an unusual formulation, is that he wanted to make plain that the Torah academies are not only of benefit to the people who study in them, but that they also are good in a transitive sense, i.e. their very existence is of benefit to the entire nation. The very name יעקב also contains such a dual meaning. On the one hand it appears to have a negative connotation, but it also symbolises עקב a heel, something at the tail end of matters, meaning after everything else has already disappeared the עקב still remains, endures. The name “Israel” that was added to Yaakov’s name was justified by this thought, that its bearer had come out of a confrontation with celestial forces and had survived, had endured. If Israel could contend with celestial forces successfully, it would certainly be able to do so with terrestrial forces, i.e. עם אנשים, (Genesis 32,29).