They shall make for Me a sanctuary so that I may dwell among them. (Exodus 25:8)
Reading the narrative, it might seem at first glance that this is merely a command for the generation of the Exodus to build the Mishkan (Tabernacle). However, the Torah already knows and acknowledges that there will one day be a Temple. It speaks frequently of the place that God will ultimately choose to cause His Presence to reside (the Temple in Jerusalem). Verse 23:19, in the previous parsha, already spoke of “the house of Hashem your God,” even before the commandment to build the Mishkan was given!
The Beis HaMikdash (Temple) was to be the center of Jewish communal life. Once built, it was the only place that sacrifices were permitted to be offered; in its absence, sacrifices were no longer permitted. Since the Beis HaMikdash was destroyed, our synagogues stand in as a “mikdash me’at,” a “miniature Temple.” (See Talmud Megillah 29a, explaining Ezekiel 11:19, “I will be to them a small sanctuary in the countries where they have gone.”)
The reason for the Temple (and the Mishkan and our synagogues) is to help us to get closer to God. He doesn’t need our prayers and sacrifices. He lacks nothing and all the cattle in the world belong to Him anyway! Rather, our words and deeds prepare our hearts and develop our relationships with Him. God does not literally dwell in a Temple or synagogue, since He has no physical form. Even His Presence (“Shechinah”) is not exclusively there, it’s only more intently felt in those places.
The obligation to build the Temple includes all the utensils necessary to perform the work of the Temple. Therefore, building the menorah, the aron (ark), the altar, etc. are not separate mitzvos, but part of a single greater mitzvah. (See the Rambam’s twelfth principle for identifying the 613 mitzvos.)
This mitzvah is the subject of the entire Mishnaic tractate of Middos, which has no corresponding gemara. The obligation to build the Temple is a communal responsibility at a time when the majority of Jews reside in Israel. It is codified in the Mishneh Torah in Hilchos Beis HaBechirah. Building the Temple is #20 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos.