The main answer to this is multi-faceted:
1. Removed absolute immunity from civil and criminal liability from all players in the criminal justice system. Yes, that means you can sue the judge who screwed up your trial. Suddenly a lot of people who are judges now will find another line of work as the liability isn't worth it for them.
2. Hone qualified immunity back to such a tiny nub that nobody sees it as a reliable fallback. Right now, if a police officer arrests you for, say, photographing them (yes, this happens often) the judge will look and say "well, it's not well established that someone can photograph a cop, so the arrest is still legal because the cop might have no known. Hence, he gets qualified immunity" This needs to be turned on its head. The judge needs to say "it's not well-established that someone can be arrested for photographing a cop, so the arrest is illegal and qualified immunity therefore cannot apply". See the difference? Again, cops would think twice before doing something.
3. Statutorily define that when an actor in the justice system does something wrong that he/she personally is responsible for a certain percentage of any settlements or judgements with such debt being ineligible to be lessened or removed through bankruptcy.
4. Remove the statute of limitations for any crimes committed by any actor in the justice system. Right now, innocent people who have been in prison for years can't sue people who harmed them because of the statute of limitations which typically runs out during their sentence. See John Burge in Chicago for a prime example, or Louis Scarcella in New York. Malicious prosecutors love the whole statute of limitations because they get to play both sides: "Hey, we want to prosecute this criminal but, darn the luck, looks like it's too late".
5. Force actual scientific method on all forensic methodologies. If a drug dog alerts on a car, for instance, that car should be parked in a lot and a different officer should take a dog around the lot and see if the dog alerts on any of the cars. If the second officer can't figure out which car it is, then the alert was false and excluded. Take that to every kind of forensic test out there.
6. Forensics should have nothing to do with the prosecution and independent (not state owned) crime labs should work for the court itself. The idea is to remove all incentives to "find a match". Crime labs should have no idea about what crime a particular piece of evidence is from or anything like that.
7. If somebody is found to be factually innocent then everybody involved in the case who didn't initially object to that person's prosecution should be removed from the criminal justice system. I know that's harsh, but prosecutors need to be in a position where they say "I don't know if this guy did it or not so, for the sake of my family, house, car, etc. I'm going to decline prosecution".
8. Prosecution's files should be not just "open" but literally unhidable from the defense. Any evidence that shows up later should be an automatic felony charge for the DA with harsh minimum sentences.
The point is that we need to treat a false prosecution with the same seriousness as we treat a kidnapping, because that's what it is. Mike Nifong should not only be in a maximum security prison for the rest of his life, his possessions should have been sold and all proceeds given to his victims (the ones we know of). All his past cases should have been scrutinized with perhaps time given off his sentence if he confessed and helped bring true justice in those cases.
And he's just one guy.