Exodus 32:26, “Then Moses stood in the gate of the camp and said, ‘Who is on the Lord’s side? Come to me.’ And all the sons of Levi gathered around him.” ESV
“This passage describes why the Levites were given the privilege of serving the Lord in the tabernacle. Apparently some of the people were still rebellious after Moses confronted them in regard to the golden calf, but the Levites responded immediately when he called for ‘who is on the Lord’s side’ (v. 26). They were then commissioned by Moses to go throughout the camp and execute the rebels. Their loyalty to God resulted in their becoming his special ministers.
The priests were a special class within the tribe of Levi. The priests’ ministry included the more sacred functions that other members of the tribe were not permitted to perform. Even though God designated all the Israelites to be a ‘kingdom of priests’ in a general sense (Exodus 19:6), a special priesthood already existed (Exodus 19:22, 24). Initially, only Aaron and his immediate sons were set apart as priests (Exodus 28:10). The inclusion of Aaron’s descendants was made a hereditary appointment after Phinehas’s act of zealous loyalty to God (Numbers 25:6-13).”
ESV Hebrew-Greek Key Word Study Bible Notes