Mishnah 6 of chapter 6. This mishnah requires some background. There are four general domains of increasing sanctity, each marked by additional mitzvos that can only be fulfilled there:
Eretz Yisrael - the entire land. Certain mitzvos, such as shemittah, Terumah and maaser, apply only in Eretz Yisrael, which shows that it has a certain sanctity.
Jerusalem - its sanctity is greater. Only within its boundaries may one eat maaser sheni and kodashim kalim, as well as offerings such as the korban Pesach, which must be eaten within the limits of Jerusalem.
The Azarah - the main section of the Temple area (there are further intermediate stages that we are not dealing with here). This is the place where the offerings are brought: the slaughtering and the other activities connected with the service are all performed in the Azarah.
The Heichal - the building that stands in the Azarah on its western side, behind the Altar. The word 'Heichal' sometimes refers only to the section called the 'Kodesh', but in our mishnah it means the entire building: the Ulam in front, the Kodesh in the middle containing the Menorah and the golden Altar, and on the inner western side the Kodesh HaKodashim. In this area too there are things that are done there alone.
How the places become sanctified:
These places are not necessarily holy in and of themselves. They need to be sanctified, meaning that this sanctity must actually rest upon them. The first time this happened was when the Jewish people entered Eretz Yisrael under the leadership of Yehoshua: Yehoshua conquered and divided Eretz Yisrael, and in doing so caused sanctity to rest upon it, and the mitzvos that depend on the land - shemittah, maaser and the like - took effect.
Everyone agrees that the sanctity that Yehoshua brought upon Eretz Yisrael "sanctified it for its own time" only. This sanctity depended on the Jewish people dwelling in the land, since conquest means that the Jews are settled there; and once they stopped dwelling there, the sanctity departed. Therefore it is agreed that following the first destruction at the hands of the Babylonians, when Eretz Yisrael lost its Jewish population, it also lost its sanctity - something that surprises some people, but that is the fact.
Afterwards the Jews returned from Babylonia and Persia in the time of Ezra, and Ezra sanctified Eretz Yisrael anew - this time not through conquest but through settlement (chazakah). For that reason the sanctity of Eretz Yisrael was brought to rest not only for its own time, but also for the future, as the Rema rules: not only for the period when they were there, but forever.
The question regarding the sanctification of David and Shlomo:
David and Shlomo sanctified Jerusalem and the Azarah, and about this there is a dispute: was the sanctification of these places also only for its own time - as long as the walls stood and the first Beis HaMikdash was functioning, and after the destruction their sanctity lapsed, both that of Jerusalem and that of the Azarah and the Temple areas - or did they sanctify it not only for its own time but also for the future, permanently, so that the sanctity continues even if the building was destroyed?
The dispute between Rabbi Eliezer and Rabbi Yehoshua:
The discussion in the mishnah revolves around this point. Rabbi Eliezer holds that Jerusalem and the Azaros were sanctified only for their own time, and therefore once they were destroyed they lost their sanctity. In order to bring offerings there again, one must set up at least temporary partitions - hangings and curtains - and designate the area that will be the Azarah. The Heichal too must be defined by curtains, since the verse requires something like "the entrance of the Ohel Moed" and "the courtyard of the Ohel Moed": these areas need to have something corresponding to the Ohel Moed - that is the Heichal - and it must have an entrance, and there must be a courtyard around it, and that is where the sacrificial service takes place.
According to Rabbi Eliezer, when they returned in the days of Ezra they could not perform the service in the Mikdash until they set up a temporary screen, at the very least, to mark the place and make it possible for sanctity to rest upon the Azarah, and likewise upon the place where Jerusalem would be. Without it, it is not possible, and that is indeed what they did in practice, for the time being.
Rabbi Yehoshua disagrees and holds that the sanctity that King Shlomo invested in the Temple area was also for the future, permanently. Therefore, even without curtains defining the Azarah and the place of the Heichal, offerings may be brought there, and likewise kodashim kalim and maaser sheni may be eaten in Jerusalem even without walls around it.
This question was highly relevant at the beginning of the Second Temple period. Once Ezra arrived, the process took a very long time: the Persians granted permission to build the Temple and then revoked it again and again, and in the end the building dragged on for twenty-two years before the service was resumed. The question, then, is whether they could have - and whether they should have - set up hangings so that the Temple could function in the interim, until they were able to build the walls.
The words of the Mishnah:
"Amar Rabbi Eliezer: shamati, keshehayu bonin ba'heichal osin kela'im la'heichal" - Rabbi Eliezer had a tradition that when they built the Heichal in the Second Temple in the days of Ezra - the building containing the Holy of Holies and the Holy - they set up hangings to define the area in which the Heichal would stand, so that it was a kind of equivalent of the Tent of Meeting. "U'kela'im la'azaros" - similarly, they set up hangings to define the area of the courtyards alone: the Israelites' courtyard and the courtyard of the kohanim, which made up most of it, and the like. In this way the courtyard was defined as the equivalent of the "chatzer" mentioned in the verse, and sanctity could be brought to rest upon it anew and offerings could be brought within that area enclosed by hangings, even though the full, solid stone structure had not yet been built.
"Ela she'ba'heichal bonin ba'chutz" - when they eventually built the actual stone wall of the Heichal, they built it on the outer side of the curtains, since once the curtains were hung one could not see into the Heichal. The idea is that people should not be able to "feast their eyes" on the Holy: the place was a kind of private space, and therefore there was a curtain concealing it from onlookers, with the wall being built around it until the structure was complete.
"U'va'azarah bonin ba'chutz" - so too when they built the courtyard that Ezra built, the Israelites' courtyard, they built it on the outer side of the hanging. Here as well, the purpose was that those standing outside the Temple and looking in should not be able to see inside without entering properly, with the honor and dignity required of one who enters the precincts of the Beis HaMikdash.
Rabbi Yehoshua disagrees and holds that none of this was necessary at all, since the sanctity that King Shlomo invested was not only for its time, during the First Temple, but for all future time, permanently. Therefore, even without those elements they had a place in which to bring offerings. This is what he says: "Shamati she'makrivin af al pi she'ein bayis" - they were able to bring offerings even though they had not yet built any structure, not even the hangings. "Ve'ochlin kodashim kalim af al pi she'ein kela'im", and likewise they eat kodashim kalim and ma'aser sheni "af al pi she'ein chomah" - even though there were no walls around the perimeter of Jerusalem, since the area of Jerusalem had already been sanctified in the days of David and Shlomo. This refers roughly to the area that today is the city center toward the Kosel and southward, toward the City of David and its surroundings - and not the greater Jerusalem we have today, whose walls were in fact built in the sixteenth century by the Turks.
It emerges that according to Rabbi Yehoshua they could eat within the ruins of Jerusalem with no walls at all, because the sanctity that had come to rest upon it was a permanent sanctity and not a temporary one. And this is the reasoning: "She'kedushah rishonah kidshah le'shaatah ve'kidshah le'asid lavo" - the original sanctification by David and Shlomo, of Jerusalem, of the Temple and of the courtyards, was not temporary, for the period of their functioning in the First Temple alone, but forever.
The ruling of the Rambam:
The Rambam rules that in Eretz Yisrael the sanctity certainly lapsed, and it had to be applied anew: only what those who came up from Babylonia conquered and took hold of again has the sanctity of Eretz Yisrael, and not the rest from the First Temple period. But regarding the rest of the Temple he holds that the sanctity applied to it was for all future time. This means that by strict law offerings could be brought in the Temple area even nowadays, even though no walls are built and so on - even though for other reasons we may not actually be able to do so. In any case, this is the law: what was done in the Second Temple period certainly stands to this day, and that sanctity is for all future time.
In summary: we learned the four domains of sanctity - Eretz Yisrael, Jerusalem, the courtyard and the Heichal - and the principle that their sanctity is not intrinsic but rather conferred. Yehoshua's sanctification was for its time and lapsed with the destruction, while Ezra's sanctification through taking possession was also for all future time. In our Mishnah, Rabbi Eliezer and Rabbi Yehoshua disagree about the sanctification of David and Shlomo: according to Rabbi Eliezer they sanctified only for their time, and therefore hangings were needed for the Heichal and the courtyards in order to bring sanctity to rest anew; according to Rabbi Yehoshua the first sanctity sanctified for all future time as well, and therefore they offer even though there is no Temple building and eat even though there is no wall. As a matter of halachah the Rambam ruled that the sanctity of Eretz Yisrael lapsed and was restored by those who came up from Babylonia, while the sanctity of the Temple stands for all future time.