This happens when you've had some crime for an extended period of time, and the criminals have built a crime network. To deal with this, use whatever method to keep the crime level at 0, stay at 0 for a few years, and the crime network will eventually be uprooted.
In beta 2.2.3 an AI criminal installs many syndicate on my planets and I put enforcer and anti crime to make it 0% crime, and for decades it still does not remove any syndicate, how to get rid of it so I can remove that building?
For crime caused by criminal syndicates, just keep the crime low, and the syndicate empire would loose profit from this planet. After some time they will either shut down the branch office due to not making money, or they will go bankrupt, by which time either you or another empire could attack the syndicate empire and destroy it. But yeah if a syndicate empire has set its mind on causing problems, there is no solution that is both easy and permanent.