Think about it like this:
In any given sting operation, the John gets arrested, bt there was never any prostitute. The arrest occurs on the basis that, if there were a prostitute, the John would participate in the exchange. Then, at that point, he's dragged before a judge or jury, and they don't really care about the crime, they just want this guy off the street based on the character assasination. The layman/plebian juror doesn't need to involve any sophisticated thought process, because his goal is to clock out of his "civic duty" by 5PM on the dot. The patrician judge is permitted the luxury of aloof detachment, and is a fallible human being. A person with a social life, biases and any other human weaknesses, despite whatever image or persona they may project into their social sphere of influence.
It doesn't really matter whether the sting is a bomb plot, drug deal, or a setup for hookers, Johns and online chat room predators. The maguffin is there to demonstrate intent, and prove that police are doing there job, the streets are safer, when this slob gets thrown in jail, and branded with a scarlet letter.
But the slob is real, and more often than not, simply being placed in the hot seat is enough for judge and jury to usually be swayed in favor of a conviction. It really doesn't take much for a person to get slapped with a jail sentence. Neither imaginary crimes nor genuine crimes weigh heavily on the mind of your typical juror. Or rather, to the juror, all crimes are essentially the same degree of fiction.
They are tales of intrigue presented to strangers who play the role of critic for a day, while attending the performance of fatal charades.