God did not make those rules; nor does God actually exist.
Religious rules were designed by wealthy aristocrats to solidify their hold to power.
Which is why half of the Bible is the Prophets condemning the Kings and the narrative itself condemning basically every king except Hezekiah and Josiah as varying degrees of immoral. Even Hezekiah(!), Isaiah's golden boy, gets knocked for not destroying the high places.
Nathan condemning David for murdering Uriah the Hittite and wedding his wife, Elijah condemning Ahab and Jezebel for the seizure of Jezreel, the entire story of Saul and Samuel's brutal condemnation of him (and monarchy in general!!!)...I guess I just imagined those and they weren't actually in the text.
Reminder, most atheists who claim to study the Bible are full of it.