Not only did David prepare the materials for the building of the Temple so that everything would be ready for Solomon. In this and the following chapters we learn how David reorganized the Levites and Cohen-priests to be ready to take up their duties in the new Temple .
V 3: "And the Levites were counted from the age of thirty years and upwards." Initially David counted the Levites fit for service using the same age criterion as God commanded Moses in the wilderness (Numbers 4:3) - only those above the age of thirty were eligible. Later, however, for reasons that will be explained below, the age for beginning their service was reduced to twenty (see vv 24-27). The tasks of the Levites in the Temple are specified at the end of the present chapter vv 28-32.
V 13: ".and Aaron was separated that he should be sanctified as most holy, he and his sons forever." Although Aaron and his sons were from the tribe of Levi, they alone were entrusted with the actual offering of all the Temple sacrifices and with blessing the people with the priestly blessing. They were therefore set apart from the rest of the tribe. The Cohanim-priests were a caste on their own with numerous mitzvos concerning limitations on their possible marriage partners, ritual purity, the consumption of Terumah-tithe produce etc. that only they were required to keep. As a mark of the unique holiness of the Cohanim, it is customary until today for all the rest of the people to give them special honor. Thus whenever a Cohen is present in the synagogue he is called first to the Torah reading, followed by a Levi, and only then are Israelites in the congregation called to the reading. The Talmud cites our present verse as the Biblical source of this custom (Gittin 59a).
V 14: Despite Moses' unique status as master of all the prophets and the nation's law-giver, and despite the fact that he himself served as the Cohen when he first inducted Aaron and his sons into their role as priests at the time of the consecration of the Sanctuary in the wilderness (Leviticus 8:5ff), Moses' children were not considered Cohanim but were counted with the other Levites.
V 16: ".and the children of Rehaviah multiplied above" - "Rav Yoseph taught that they multiplied over 600,000" (Berachos 7a). Rabbi Nachman taught: "Know that there are children that are born into this world, but in addition there are very great 'children of ascent' who are born as souls that are above the souls that are clothed in the children born into this world. For all the souls in this world are included in the 600,000 souls of Israel , and even though there are greater numbers of people, this is only because the sparks are divided. But the souls that cannot be clothed in this world are above these 600,000 souls. and even when they enter this world they are not considered part of this world at all. This is the category of the children of Moses, of whom it is written that 'the children of Rehaviah multiplied ABOVE'. This is why the Rabbis taught that they were 'over 600,000' - because they are not considered to be included in the 600,000, for they are above and beyond them (Likutey Moharan I, 273).
Verses 24ff explain why David eventually counted all the Levites who were over 20 years old rather than only those who were above the age of 30. Now that God had "given rest to His people" and chosen to dwell in Jerusalem forever (v 25), the burden of carrying the Sanctuary and its vessels from place to place would no longer fall upon the Levites, who from now on would only be required to sing in the Temple and perform guard and other duties there. For these they would not require the full strength of a mature man of thirty but could already start to serve at the age of twenty (Metzudas David on v 26).
V 27: "For by the last ordinances of David, the Levites were numbered from twenty years old and above." - "This means that even though in David's own words above (v 3) only those Levites above the age of 30 were counted, in his final ordinances those over 20 were also counted. Initially, however, this did not occur to him and he counted them only as prescribed in the Torah (Numbers 4:3) from the age of 30 and above" (Metzudas David ad loc.).
Verses 28-32 give us many important insights into the varied functions of the Levites in the Temple . It is evident from numerous Talmudic sources that they continued carrying out the same functions allocated to them by David until the end of the Second Temple period. ".Because their station was at the side of the sons of Aaron [the Cohanim]" (v 28). The role of the Levites was to do everything necessary in the Temple to enable the Cohanim to conduct the sacrificial services. Thus the Levites were responsible for the guarding and maintenance of the entire Temple precincts including all the different courtyards and chambers, and they also had to ensure the ritual purity of all the Temple areas, vessels and sacrificial offerings (v 28). They prepared and baked the Show Bread and other grain-based offerings (v 29) as well as providing the singers for the Temple services (v 30). They had to ensure that the requisite sacrificial animals were ready and checked for blemishes prior to all the daily, Sabbath, New Moon and festival offerings (v 31) and provided squadrons of guards in key positions around the Temple (v 32). There were times when the Levites also assisted the Cohanim in flaying the sacrificial animals (Rashi on v 31, cf. II Chron. 29:34).
Having organized the Levites and allocated them their duties, David proceeded to reorganize the Cohanim into twenty-four priestly squadrons that would serve in the Temple on a rota basis week after week.
V 4: "And the males of the chief families of the children of Elazar were found to be more numerous than those of the children of Ithamar." Rashi (ad loc.) explains: "Initially in the Sanctuary in Shilo there was a total of only sixteen priestly squadrons, eight from the descendants of Elazar and eight from those of Ithamar, as is explained in Tractate Taanis 27a. But when David saw that the males in each of the chief families of the descendants of Elazar were twice as many as those of the families of Ithamar, he organized the descendants of Elazar into sixteen squadrons while leaving the descendants of Ithamar in their eight existing squadrons, and we find proof of this in the Hebrew text of verse 6" (Rashi on v 4; see also Metzudas David on v 6).
V 5: "And they divided them by means of lots, these with those." The purpose of the lots was to determine in which order the squadrons would serve week by week in rotation. The average Jewish year is 51 weeks. During the three annual pilgrim festivals all twenty-four squadrons would take part in the festival sacrificial services, leaving about 48 weeks for the regular rota. Thus each squadron had an average of two weeks of Temple service during the year besides the time they served on the festivals.
V 6: "And Shemayah the son of Nethan-el the scribe from the tribe of Levi wrote them in the presence of the king." The apparent PSHAT of this verse is that Shemayah the scribe recorded the order in which the priestly squadrons would serve week after week as revealed through the lots. However the Targum darshens that Shemayah ben Nethan-el is another name for Moses, "the great scribe", and that it was he who wrote down the original order, which was later read in the presence of the king (see Targum Rav Yoseph on v 6).
Verses 7-18 give the names of the twenty-four priestly squadrons and their order in the rota.
Verses 20-30 review the names of the principle families of the Levites. While many of the functions performed by the Levites in the Temple appear to have involved continual service throughout the year, the Levitical singers were divided into twenty-four squadrons corresponding to those of the Cohanim, and they took turns week by week in singing in the Temple choir. The twenty-four Levitical squadrons consisted of nine from the descendants of Gershon, eight from those of Kehath and seven from those of Merari (see Metzudas David on v 30).
V 31: ".the head of each father's house in the same manner as his younger brother": this means that the order of the various families' seniority in terms of age was of no consequence in determining their order in the rota of service: there everything was determined by the lot - GORAL - which was determined by the Almighty.