In this chapter, King David appoints gatekeepers and treasury officials for the temple.
This chapter continues the progression of 1 Chronicles 23-25 which I discussed in my previous commentary on chapter 25. This is the final chapter in this logical progression which is basically showing us the proper dispensation of Levites and priests in the temple complex. Having established the priestly service rotation and the worship ministry, David now concludes with the gatekeepers, treasurers, and a few brief footnotes about additional Levites assigned as officials and judges. This general organization was laid out in 1 Chronicles 23:4-5, which was the introduction for this whole section.
A few minor notes before we really get into it: Obed-edom in verse 4 (and onwards) is likely the same Obed-edom who hosted the ark of the covenant in his house in 2 Samuel 6:10. He is now a temple official. In verse 10, Shimri is appointed the first in the same way that Joseph is granted the inheritance of the firstborn by Jacob. This was not very common (at least as recorded), but fathers had the right to grant the honor and privileges of the firstborn to the son of their choice. Deut 21:15-17 provides an exception to this, prohibiting Israelites from granting the privileges of the firstborn to a loved wife over the son of an unloved wife, but in general if both sons are from the same wife then the father is permitted to grant the title to the son he prefers.
Okay, now with that out of the way, let's move on to the bulk of this chapter.
First, who are the gatekeepers? The gates were for passage into the temple complex. The outer court has several entrances, and these are the gates that are mentioned in e.g. verse 14-16 in addition to the Shalleketh gate that is possibly in the area but not a gate to the outer court. I say "possibly" because I don't know where the Shalleketh gate was located; this is the only reference to this name in the entire bible. We can assume it was somewhere in the area of the temple. While there are many entrances to the outer courts of the temple complex, the inner court and holy place have only one entrance each (on the east side) and as far as I can tell there were no guards assigned to the holy place or the inner court in this chapter, though we might reasonably assume they were both guarded anyway. In any case, we can also see that there is at least one associated building in the temple complex that is guarded, the storehouse. It's possible there were other buildings in the temple courts as well.
We don't know the exact design of Solomon's temple complex. Certainly scholars have spent an enormous amount of time divining the layout and organization of the temple complex and there may be detailed (and speculative) descriptions available online, but much of this information is not directly available in the biblical text. Chronicles was evidently written to people who already knew about things like the Shalleketh gate.
What is the purpose of the gatekeepers? I think the guards have two general roles. First, they are there to protect the treasures of the temple. Like we read in verse 26-28, the temple sometimes served as a depository for loot and plunder from battle. These things were dedicated for religious purposes, although that didn't stop future kings from sometimes raiding the temple to pay tribute or to bribe their enemies (1 Kings 15:18). The guards couldn't stop the king, but they could at least stop common thieves. The second purpose of the gatekeepers is to keep out gentiles, foreigners and the ceremonially impure from entering beyond where they were permitted. In later times there is a so-called court of the gentiles, but I'm not sure if it existed in Solomon's temple. In any case, the guards would have had detailed instructions about who was permitted into the temple complex and they would have been responsible for enforcing those rules.
What is the purpose of the treasurers? Similar to the gatekeepers, they would have been more directly responsible for the treasures of the temple. Besides guarding the treasures, they probably also handled accounting and tracking them, as well as receiving and accounting new offerings. It was obviously a significant responsibility given the number of people tasked with this.
Lastly, some of the Levites are also assigned as officials and judges in verses 29-32. This shows again that religious and political affairs are tightly coupled in ancient Israel. We see this very clearly in v. 32 where it says that the Levites were responsible "for every matter pertaining to God and for the affairs of the king". This makes sense in the context of the Law of Moses, since that law itself is a mixture of civil and religious affairs. We should understand the temple more broadly as almost a hybrid of religious and royal administration. The treasury served to finance the temple, but as noted previously the kings were not above plundering it when in need. Also, even though I painted these chapters as a demonstration of David's zeal for the temple, we should not ignore the political implications of David appointing the Levites to these positions. I think it is the Chronicler's intent to show David's zeal for the temple, but I think the practical implication is that David is also exercising his authority over the religious institution. It should not surprise us when the Levites end up serving in both religious and political roles in service to the king, and I believe that is what we are seeing.
This chapter concludes the organization of the priests and Levites in Solomon's temple. In the next chapter, David conducts a census of Israel's military and places officers over them and over his royal property.