Gershon, Kohath, and Merari were the sons of Levi.
The sons of Levi were Gershon, Kohath, and Merari.
David organized the Levites into divisions based on which of Levi’s sons (Gershon, Kohath, or Merari) they were descended from.
So Moses did what the Lord said and registered them as he had been commanded.