The ancient Israelites were obsessed with eradicating evil. God sent the flood when mankind was evil, and God destroyed Sodom and Gomorrah because the inhabitants were evil.
The Talmud discusses the evils of Sodom.
For example: The inhabitants of Sodom wounded another man. The victim came before the court and demanded compensation for the injury. The judge told the victim, “Pay the assailant a fee, because he wounded you.”
Another example: Guests come to Sodom, and the inhabitants of Sodom had beds on which the inhabitants of Sodom lay their guests. When the guest was longer than the bed, they were cut to the size of the bed. When the guest was shorter than the bed, the inhabitants of Sodom stretched the guest to fit the size of the bed.
A third example: When a poor person would come to Sodom, each inhabitant would give the poor person a coin, and the inhabitant’s name was written on the coin. However, the inhabitants of Sodom would neither give nor sell the poor persont bread. So the money was worthless and the poor person died of hunger. When the poor person died, the inhabitants of Sodom each took back their coin.
The ancient Israelites lived in a world that was less civilized than ours. They accepted evil in their world, and they thought God was the source of all good and all evil. The first b’rachah before the Sh’ma (page of 107 of Shabbat Siddur Sim Shalom), reads,
Praised are You, Adonai our God, who rules the universe, creating light and fashioning darkness.
The source of the b’rachah is Isaiah 45:7:
[God] forms light and creates darkness, [God] makes peace and creates evil . . . .
The ancient Israelites wanted to eradicate evil, and so do we. It is human nature to be greedy and impolite and hostile, and make laws to keep human nature in check. The Israelites made God to try eradicate evil, and God failed miserably, because humans, as I said, are greedy, impolite, and hostile, and God also created evil in the world. We don’t have luxury of God doing our dirty work, and we need do it ourselves.