The cops can commit crimes in the pursuit of justice. They cannot hurt anyone, there are standards, their actions have to be authorized, and there is a review process. This has always been the case. Cops can sell drugs while busting those buying or selling drugs. But they're not commiting crimes for personal gain or entertainment.
Really, the problem is people only object when the cops bust people for things they don't think should be crimes like drugs or prostitution. When they ask somebody to buy or sell drugs, give then drugs to sell, pay them, whatever, and they say "yes" people scream "entrapment!" When that's not what entrapment is. You were free to say no and walk away at any time. Entrapment is the corruption of your free will. Coercsion. "Commit this crime or we'll kill you or your mom." That's actually entrapment. But it's perfectly fine to ask people to commit crimes and then bust the ones who say yes.
When the same tactics work for other crimes, nobody cares. People cheer. Like a cop posing as a hitman a woman hires to kill her husband. Busted! And nobody cries "Entrapment!"
Part of the purpose of jail is to separate those who would harm from the rest of society so they can't hurt us.
"Wanna go rape and murder toddlers?" "Boy would I!" Jail.
"I wanna rape and murder toddlers but I don't have a stabbin' knife." "Oh I'll give you one!" "Thanks!" Jail.
"I don't wanna rape and murder toddlers." "Give you $50." "Okay then!" Jail.
Do you really not want any of the people who would say yes to (and actually attempt to carry out) those actions in jail? Of course you would! The practice is fine. People only get butt-hurt when the target is a drug user instead of a toddler murderer.