... Thou shalt not let any of thy seed pass through the fire to Molech, neither shalt thou profane the name of thy God...
Leviticus 18:21 And thou shalt not let any of thy seed pass through the fire to Molech, neither shalt thou profane the name of thy God: I am the LORD.
[In Judges, though, the tale of Jephthah, who led the Israelites against the Ammonites, is being told. Being fearful of defeat, this good religious man sought to guarantee victory by getting god firmly on his side. So he prayed to God] "... If thou shalt without fail deliver the children of Ammon into mine hands, Then it shall be, that whatsoever cometh forth of the doors of my house to meet me, when I return in peace from the children of Ammon, shall surely be the LORD’s, and I will offer it up for a burnt offering”
Judges 11:30-31 And Jephthah vowed a vow unto the LORD, and said, If thou shalt without fail to deliver the children of Ammon into mine hands, Then it shall be, that whatsoever cometh forth of the doors of my house to meet me, when I return in peace from the children of Ammon, shall surely be the LORD'S, and I will offer it up for a burnt offering.
[The terms were acceptable to god — remember, he is supposed to be omniscient and know the future — so he gave victory to Jephthah, and the first whatsoever that greeted him upon his glorious return was his daughter, as God surely knew would happen if God is a god. True to his vow, the general made a human sacrifice of his only child to god!]
Judges 11:29-34 ¶ Then the Spirit of the LORD came upon Jephthah, and he passed over Gilead, and Manasseh, and passed over Mizpeh of Gilead, and from Mizpeh of Gilead he passed over unto the children of Ammon. And Jephthah vowed a vow unto the LORD, and said, If thou shalt without fail to deliver the children of Ammon into mine hands, Then it shall be, that whatsoever cometh forth of the doors of my house to meet me, when I return in peace from the children of Ammon, shall surely be the LORD'S, and I will offer it up for a burnt offering. So Jephthah passed over unto the children of Ammon to fight against them, and the LORD delivered them into his hands. And he smote them from Aroer, even till thou come to Minnith, even twenty cities, and unto the plain of the vineyards, with a very great slaughter. Thus the children of Ammon were subdued before the children of Israel. And Jephthah came to Mizpeh unto his house, and, behold, his daughter came out to meet him with timbrels and with dances: and she was his only child; beside her, he had neither son nor daughter.
God repeatedly and consistently condemns human sacrifice, to the extent that it was a major reason the nations of the Canaanites were destroyed for practicing it so that the abominable practice would not spread to other nations (including Israel, who were warned against adopting the practice). Israel was horribly punished for practicing human sacrifice in defiance of God's commandments. See Destruction of Canaanites. American Atheists put words in God's mouth by falsely claiming that He approved of Jephthah's actions; indeed Jephthah himself met a horrible end, executed and burned down with his whole house. (Judges 12:1-7) If God approved of Jephthah as American Atheists insinuate, why didn't God let Jephthah face a more peaceful end to his life, such as those God actually approved of? (cp. 2 Chr. 34:28; 2 Ki. 22:20; 2 Chr. 34:28; Jer. 34:5)
God can know the future but does not always choose to know it. If He did not have the ability to not know the future, He would not be all-powerful. The Bible calls God omnipotent but never omniscient. As such, God is surprised throughout the Bible by the actions of mankind in rebelling against Him. (Genesis 4:9-11, 6:6) See Problem of Evil. God is not the author of evil. Satan sows evil among mankind to sabotage God's good creation, per Jesus' Parable of the Tares. (Mt. 13:27-43)
The Bible constantly describes mankind, even leaders of Israel like Jephthah, constantly doing evil actions that God disapproves of, for which Israel is punished. See e.g. King Ahab. Just one chapter before the case of Jephthah being discussed, in Judges 10:10-14, God goes on one of the most epic rants against the Nation of Israel found in the Bible, pointing out that He delivered the Israelites from the Amorites, Ammonites, Philistines, Zidonians, Amalekites, and Maonites; because each time they sinned against Him and He delivered them from one nation, they would go right back and sin again, so that He would punish them all over again by sending them into captivity to another foreign nation. A fed-up God screams at Israel in chapter 10, "You have forsaken me and served other gods, so I'm not going to deliver you anymore! Go and cry to the gods you've chosen, let them deliver you from your trouble." (vv. 13-14)
Needless to say, any degree of reading the Bible in context shows that God hardly preordains the actions of people, or knows what they will do ahead of time. God constantly punishes the Israelites and their leaders for disobeying Him, indeed it would be difficult to find a more consistent theme throughout the entire Old Testament. God never once in the Bible approves of human sacrifice and made a point of showing Abraham that his son Isaac should be spared. (Genesis 22:12) Many things are written throughout the Old Testament which describe cases God disapproved of, and for which those responsible were punished. The end of Jephthah, a violent execution and burning down of his house, in contrast to the peaceful deaths of those blessed by God, is itself indicative of God's disapproval of his immoral actions.
- N.a. (2019). "Biblical Contradictions? American Atheists.