Numbers is part an extension of the narrative from Exodus, part rule book. It’s cut together with a strange sense of theatre. Ever since a major rebellion where the people freaked out about being lost in the desert, is been chapters of rules.
Here are elaborate purification rules for dead things. This has a dual purpose. Dead bodies really are a health risk, and these rules would have reduced the risk of disease from them greatly.
But death is also the antithesis of God’s holiness. Death is like sin in visible form. The rituals are making it clear that God is life.
People get mad at the Old testament because God has so much death. But there is always so much death and the globe regardless of the and place. A more important question is does it mean anything and do we learn from it. Good uses death to teach us about life. Here. Jesus. The sacrificial system. Battles and wars. Disease.