Humanity needs replicants; replicants obey their owners.
They are the cheap (or even slave) labour - something really necessary in the collapsing ecosystem; they are also better soldiers than humans and any governments wants to have better soldiers - especially such cheaply made.
Replicants as a force never were threatening the government, only the public pressure caused by the Nexus-6 rebellion forced the "replicant prohibition", but as soon as Wallace was able to show, that Nexus-9 is obedient by making the replicant to cut his own throat, they've jumped at the opportunity to reintroduce them to the economy. Of course now everybody is bit more cautious - the problematic Void-Kampf test has been made obsolete by simply marking all models and the "baseline test" constantly checks for any issues within working models.
Now, the example of K, Luv or the rebel group (although we don't know are they the new Nexus-9 or the old, hiding models) shows that the obedience is not perfect - in time they can start going rogue. But if you look at K, you will notice how meek he actually is - he is not a rebel bringing torch to the system, not another Roy Batty that wants to kill his creator (the scene when Roy descends in elevator the comic novelization described as "That's how Lucifer must felt when he defied God") - instead he just wants to find the truth about himself. Also (someone correct me) K never directly disobeyed his supervisor's orders - his boss gave him 48hrs before they will chase him.
Luv seems initially as a bit of exception, since she is a cold blooded killer, but please notice that she is still obedient, but to Wallace and only to him! She is not killing from hate of "human oppressors" but because those humans are in her master's way. It is not hard to imagine, that as a right hand of Wallace (and probably his bodyguard) she would be less restricted to killing. She is thinking as soldier (or to a degree - a policeman)in category "us and them" and she is obedient in following orders.
In other words - replicants are "safe to use" just like i.e. cars or heavy machinery is safe - occasional accidents might happen but we do need them, so we still use them while minimizing the risks.