Aside from the priestly guards who were stationed in three places in the Temple courtyard (see above, daf 25), the first Mishna in Massekhet Middot teaches that there were additional guards of levi’im who manned 21 different posts outside of the Temple – on the Temple Mount, at the gates to the Temple courtyard and so forth.
The Gemara on today’s daf discusses these guards and teaches that the guards on the Temple Mount stood inside the walls, while those who were responsible for the Temple courtyard stood outside the walls. The explanation given for this is that in the event that the guard became tired and wanted to sit, he could do so on most places in the Temple Mount, but not in the courtyard, where it was forbidden for anyone to sit, aside from the kings from the David dynasty.
The reason that it was generally forbidden to sit in the Temple courtyard was for reasons of honor to the Temple. Furthermore, all of the biblical passages that discuss the Temple service use the language of “standing” while serving (see, for example, Devarim 18:5, 7).
The exceptions to this rule that are brought by the Gemara are Davidic kings, who are allowed to sit in the Temple courtyard. We find, for example, that King David himself sat before God (see II Shmuel 7:18), as did his son, King Shlomo (see I Divrei HaYamim 29:23). The reason for this is that the Sages want to emphasize that the Davidic dynasty deserves to be honored in a similar manner to the honor given to God. Some suggest that the prohibition against sitting in the Temple is not absolute, but it was instituted to honor the Davidic kings by allowing only them to sit. Support for this position is the story of Eli HaKohen who we find sitting by the Tabernacle in Shiloh (see I Shmuel 1:9).