Bamidbar24:5

מַה־טֹּבוּ אֹהָלֶיךָ יַעֲקֹב מִשְׁכְּנֹתֶיךָ יִשְׂרָאֵל׃

How good are your tents, Yaakov, your dwellings, Israel!

Bamidbar 24:5

מַה־טֹּבוּ אֹהָלֶיךָ יַעֲקֹב

Bamidbar / Numbers 24:5

מַה־טֹּבוּ אֹהָלֶיךָ יַעֲקֹב מִשְׁכְּנֹתֶיךָ יִשְׂרָאֵל׃

How good are your tents, Yaakov, your dwellings, Israel!

Pshat פְּשָׁט

Doors apart

Rashi: Bilam (Balaam) saw that the openings of the tents did not face one another: no one looks into a neighbour's home. Another explanation: the tents are Shiloh and the Temple, and "dwellings" (מִשְׁכָּן) is "pledge" (מַשְׁכּוֹן): even the destruction of the Temple atones for the people. Malbim: a tent is the temporary home of the desert, a dwelling the permanent home in the Land of Israel, and there the people will rise to the name Israel.

How Rashi and Malbim explain it

Remez רֶמֶז

Tent and home

Ba'al HaTurim: the verse has six words, matching the six places where the Presence of the Creator dwelt: Nov, Givon, Gilgal, Shiloh and the two Temples. The Ohev Yisrael reads the names by their letters. Yaakov (Jacob) (יַעֲקֹב) is a yod (י) in the "heel" (עָקֵב): God is found only at the end of a deed. Israel (יִשְׂרָאֵל) is "straight to God" (יָשָׁר אֵל): a person cleaves to Him from the very start. Let the first be a temporary tent, and the second a permanent home.

How Kitzur Ba'al HaTurim and Ohev Yisrael explain it

Drash דְּרָשׁ

A blessing turned around

The Talmud: from the wicked man's blessing one sees what was in his heart. Each blessing of Bilam (Balaam) is a curse the Eternal turned around: Bilam wanted Israel to have no synagogues and houses of study, and he said "how good are your tents". Midrash Lekach Tov: the tents are houses of study, the dwellings are synagogues.

How Talmud, Sanhedrin and Midrash Lekach Tov explain it

Sod סוֹד

The house of Yaakov

The Ba'al Shem Tov: Avraham called the place of the Temple a "mountain", Yitzchak (Isaac) a "field", and Yaakov (Jacob) a "house", and the future Temple will be built by Yaakov's merit and will no longer be destroyed. Why not from the start? When anger comes, the Eternal pours it out on the wood and stones of the Temple, taken as a pledge (מַשְׁכּוֹן) for the people. Bilam (Balaam) wished for a Mishkan "by Yaakov's merit", indestructible, so that Israel itself would become the pledge.

How Ba'al Shem Tov explain it