When you're charged with a crime, you're in a tough spot. As soon as charges are filed, you're faced with the necessity of either (1) negotiating a plea bargain, which means you'll plead guilty to something or other; or (2) going to trial, where you risk a much more serious conviction if the jury doesn't believe you. Facts are often confused. The prosecution has access to law enforcement for its investigations. You'll have to pay for yours.
It's a big enough challenge when everybody plays things straight. But what about when you've got a prosecutor willing to lie? Then things are worse. And given that prosecutors often face no consequences for misconduct, it's not surprising that some are willing to lie about it.
...Our criminal justice system depends on honesty. It's also based on the principle that people who do wrong should be punished. Prosecutors, however, often avoid any consequences for their misbehavior, even when it is repeated.
Worse yet, prosecutors are also immune from civil suit, under a Supreme Court-created doctrine called "absolute immunity" that is one of the greatest, though least discussed, examples of judicial activism in history. So prosecutors won't punish prosecutors, and victims of prosecutors' wrongdoing can't even sue them for damages.
That leaves courts without much else to do besides throwing out charges in cases of outrageous misconduct. But if we care about seeing the law enforced fairly and honestly, we need more accountability.