As for US criminal law, it is written mostly by the states. There are federal crimes but those are specifically targeted at egregious and interstate acts.
But, most states base their laws on the American Law Institute (a think tank) Model Penal Code (

giggle

). Thus, most state criminal laws are similar - but with different nuances. In a nutshell.
But, all things considered, this could happen anywhere. This was a "undercover" cop working to bust drugs in Texas. Sorta like the movie "Rush." It was frame-up after frame-up. Even with your typical bureauons reviewing cases, it's hard to avoid the injustice that will occur when the primary fact-finder lies.
The cops don't prosecute cases. They build a fact file and then the prosecutor (a lawyer) takes the case to trial. Watch the US TV show Law & Order for a conservative's wet dream of how the system works at its best.
So, obviously the cop didn't completely act as judge jury & executioner in these matters. But, he handed over false facts to the lawyers who then ran with those facts.
Now, if the prosecutors (or one boss prosecutor) are equally corrupt, it only worsens the situation. And, if you've got a corrupt criminal court judge in town too, well, you get the picture.
It's not a USA problem - could happen in any system.
And, I agree with MagiK we should punish cops harder when this stuff happens. Especially since the "fraternity" nature of officers makes them so hard to catch.