It wasn't just two women.....the Israelites were set up by Balak and Balaam so that they would offend their own God and receive his curse all by themselves.
"Balaam still entertained hope of having that rich reward for which he had come so far and for which he had worked so hard. If he could not curse Israel himself, he reasoned, perhaps God himself would curse his own people, if only they could be seduced to engage in sex worship of the Baal of Peor.
So “Balaam . . . went teaching Balak to put a stumbling block before the sons of Israel, to eat things sacrificed to idols and to commit fornication.” (
Re 2:14) “By Balaam’s word,” the daughters of Moab and Midian “served to induce the sons of Israel to commit unfaithfulness toward Jehovah over the affair of Peor, so that the scourge came upon the assembly of Jehovah.” (
Nu 31:16) The result: 24,000 men of Israel died for their sin. (
Nu 25:1-9)
Neither Midian nor Balaam escaped divine punishment. Jehovah commanded that all the men, women, and boys of Midian be executed; only virgins were spared. “And they killed Balaam the son of Beor with the sword.” (
Nu 25:16-18; 31:1-18) As for the Moabites, they were barred from the congregation of Jehovah “to the tenth generation.”—
De 23:3-6."
https://wol.jw.org/en/wol/d/r1/lp-e/1200000543?q=midian+balaam&p=par
The Jews had God's laws and they were very specific. They were an imperfect people shackled to a perfect law that none of them could keep perfectly. It was designed that way so that the Jews were reminded on a daily basis that they were sinners in need of a savior.
When God sent the Savior, they rejected him because the Jewish Leaders hated him and went on the offensive with their own campaign against him, accusing him of being in league with the devil and charging him with blasphemy for claiming to be "the son of God".
Seeing his miracles, the crowds went after him and he showed them foregleams of what life under his Kingdom's rulership would be like.....healing the sick, restoring deformities, expelling demons and even raising the dead. But when he was arrested and brought before Pilate, he was found to be innocent of any legitimate charges incurring the death penalty. But the crowd went into an uproar and, under the influence of their religious leaders, clamored for his death, even cursing themselves and their children with his blood. (Matthew 27:25) They got their wish.
He did not elevate the Pharisees as they expected the Messiah to do, but he shamed them and exposed their hypocrisy which tore them to shreds. Any wonder that they plotted to kill him? Jesus said that is the way they always dealt with the prophets sent to correct them. (Matthew 23:37-39) God was left with no choice but to abandon them.