That's literally what scripture says. This is not a claim about the nature/ontology of the laws. It is a claim about the function that YHWH's good laws had upon sinners. Let's look at the verse in context, and it will make sense. YHWH (through Ezekiel) was speaking about the Israelite generation that was condemned to die in the wilderness:
Notice the parallel between the above two "law clauses": "rejected my ordinances" and "did not walk in my statutes". These clauses mean the same thing. We will see this parallelism several more times before we are done.
But YHWH was merciful. He could have killed them immediately, and started over with a remnant of their children. Instead:
This is our second set of parallel law clauses, but now they refer to something which the Israelites were supposed to shun: "Do not walk in the statutes of your fathers" and "neither observe their ordinances." Notice that these parallel law clauses still mean the same thing. But they are referring to the laws of the fathers, which are not the laws given by YHWH.
Another warning with a third set of parallel "law clauses" (which again mean the same thing). These are YHWH's laws, which should be obeyed. Again, the children -- the same ones from v. 18 -- disobeyed, just like their parents:
A fourth set of parallel law clauses, which (again) mean the same thing. Notice the phrase "which if a man do, he shall live in them." The opposite is, obviously: if you don't follow the statutes and ordinances, you will die. Yet YHWH, in his mercy, still held back.
There was still -- to external observers ["in the sight of the nations"] -- a chance that YHWH would merely allow them to be "scattered" "among the nations." Ezekiel is still referring to the group in the wilderness.
A fifth set of parallel law clauses, again with the same meaning. This is two whole generations of law-breakers and idolaters. And now we come to the verse in question:
This is now our sixth set of law clauses:
1. "Statutes that were not good"
2. "Ordinances in which they should not live"
Again, these clauses mean the same thing: if you disobey these laws, you will die. That is not a good outcome for the sinner. Also, YHWH takes no pleasure in the death of the wicked (Ezek. 18:23, Ezek. 33:11). These are the same laws as above. The "not goodness" of these statutes thus consists in the judgement effect of disobedience to them, which we are about see. Because YHWH had restrained his hand from destroying them (v. 22), these wilderness wanderers progressed to one of the worst crimes possible: Molech-worship (child-sacrifice).
The Hebrew word which is translated as "defiled" is timme. The commentator Daniel Block writes:
Yahweh defiled his people. One can see how radical this notion is in that nowhere else in the OT does Yahweh appear as the subject of the verb timme (Piel).
(Block, The Book of Ezekiel: Chapters 1-24 [NICOT], 636)
Here is what God's law says about this crime of Molech worship/child sacrifice:
YHWH promises to bring judgement directly upon those who engage in this type of idolatry. And this is what he did to that wilderness generation.
"They" at the end of v. 26 probably refers to the remnant of children who survived from the wilderness (and their descendants). The destruction of this generation would be remembered by these future generations, who would "know that I am YHWH."