Also with uplifted hand I swore to them in the desert that I would disperse them among the nations and scatter them
through the countries, because they had not obeyed my laws but had rejected my decrees and desecrated my
Sabbaths, and their eyes lusted after their fathers' idols.
I also gave them over to statutes that were not good and laws they could not live by;
I let them become defiled through their gifts - the sacrifice of every firstborn - that I might fill them with horror so
they would know that I am the LORD.
God is not saying that he gave bad laws to the Israelites, but that he gave the Israelites over to the bad laws they had created for themselves. The Israelites had rejected the laws God did give them, despite repeated warnings and punishments (20:8-21), and so as a greater punishment God no longer corrected them, but allowed them to do as they pleased and reach greater levels of depravity. Verse 26 seems to say that the Israelites might become horrified at their own sin as a result, and then turn back to God.
This notion of God "giving people over" to their own evil desires also appears in Psalm 81:11-12 and Romans 1:21-28. Psalm 81:12 states it clearly: "I gave them over to their stubborn hearts to follow their own devices."