Additionally, selective enforcement is primarily a tool of corruption. The law is supposed to apply to everyone. If it doesn't, then those who enforce it get to selectively choose to not enforce it against themselves and only enforce it against their enemies. And, as we've said, the government has very disproportionate power against its citizens, so to give prosecutors, police, or other enforcers of the law very broad, rarely used precedents is extremely dangerous.
A defense attorney who has proof that their client is 100% guilty must still defend their client to the best of their ability. A prosecutor who believes that the accused is innocent is ethically required to dismiss the case. (Obviously, this doesn't always happen, but it's supposed to.)
Add to that the costs of defending a court case, and the prosecutor has more-or-less complete power - they can financially ruin someone at will, just (as in this case) by deciding to enforce an obscure law that the defendant didn't even know about.
So making the prosecutors adverserial to the citizens, while giving them absolute power to destroy anyone they don't like, is a recipe for corruption.