Hebrew paragraph divisions and chiastic structures are explained more thoroughly in the teaching tools of scripture.
The paragraph divisions of Matot are:
Num 30:1-16 p The law concerning vows
Num 31:1-12 s Defeat of Midian
Num 31:13-20 s Kill the women and male children, be purified on the 3rd, 7th days
Num 31:21-24 s Purification of metals + 7th day to come into the camp
Num 31:25-54 p The division of the plunder
Num 32:1-4 s The country on the east side of the Jordan, a land for livestock
Num 32:5-15 s Reuben + Gad, do not take us over the Jordan; Moses’ rebuke
Num 32:16-19 p We will cross over armed with Israel to cause them to inherit
Num 32:20-42 p Reuben, Gad, half of Manasseh inherit east of the Jordan
The strong theme formed by the paragraph from Num 31:1-54 might be Victory for Israel over Midian. The strong theme formed by the paragraph from Num 32:1-19 might be Reuben + Gad’s inheritance on the east side of the Jordan.
Matot forms a chiastic structure by itself:
1a) Num 30:1-16 p, The law concerning vows;
1b) Num 31:1-8, One thousand from each tribe prevailed over Midian;
1c) Num 31:9-12 s, Israel took the women and children of Midian captive, and took spoil and booty;
1d) Num 31:13, Moses met them outside the camp;
1e) Num 31:14-15, Moses was angry with the officers and captains: Why were the women of Midian kept alive?;
central axis) Num 31:16, These were the women who enticed Israel re: Baal of Peor, by the counsel of Balaam;
2e) Num 31:17-18, Kill the women and male children, keep the female children for yourselves;
2d) Num 31:19-24 s+s, Remain outside the camp seven days for purification;
2c) Num 31:25-47, Division of the plunder of Midian;
2b) Num 31:48-54 p, Not a man missing of those who went to war + memorial offering of the victory over Midian;
2a) Num 32:1-42 s+s+p+p, Reuben, Gad, and half Manasseh vow to cross over armed before Israel.
This is one of the incidents in Torah for which people label God vengeful, wrathful, angry, and judgmental. Some people are embarrassed by the commands and actions of God and Moses in the Old Testament.
God is a just judge, And God is angry with the wicked every day. Psa 7:11
The fear of the Lord is clean, enduring forever; The judgments of the Lord are true and righteous altogether. Psa 19:9
Righteous are You, O Lord, And upright are Your judgments. Psa 119:137
The entirety of Your word is truth, And every one of Your righteous judgments endures forever. Psa 119:160
There were many nations around Israel at this same time who worshiped their idols, and God left them alone; He did not charge Israel with carrying out any judgments against them. So what was it about Midian which caused God to break that pattern?
The central axis reveals it. Balaam came to curse Israel, we saw. When he could not curse them directly, he came up with an evil strategy to curse them indirectly; to cause them to curse themselves by forsaking God. The Midianite women set Balaam’s plan into action and enticed Israel into idolatry. They were the stumbling block the enemy put in front of Israel’s feet.
They were not just going about their business, living their lives and engaging in their idolatry as they had always done. They laid a trap for Israel which they believed would end in Israel’s destruction. It is the same as premeditated murder, because their goal was to end the nation.
The punishment for murder is death. That is a just and righteous judgment. It is a merciful judgment, because future victims are saved when a murderer receives this just judgment. Punishments for sin exist, because sin always hurts someone.
It is also my belief that this passage is prophetic — that this is one of the instances in Torah of history that prophesies. The enemy wages spiritual warfare against God’s people through his agents, but he will not ultimately succeed, and his end will be destruction, as this history with Midian illustrates.