There are many reasons “bad” cops are tolerated.
In the case of my last department, it goes like this.

Sgt promoted to chief because the rest of the applicants backed out or refused.
(Incompetent and lazy to a criminal level literally) But the city council chose him.

My replacement was hired despite issues in the background. And he was making up for the past and proving to be a very good cop. Right up to the point he fell off the wagon, a past work injury and pain meds ruined him.
The DAs office is still considering charges.
He quit and can never be employed in a LE capacity again.

Why wasn’t he fired or charged by the chief who was investigating him?
Too embarassing as he had done the background and hand picked him

Why nothing yet from the DAs office?
The chiefs incompetence doesn’t help, but they have to review every case he touched. Every case becomes suspect and they have to decide if justice is better served by releasing and possibly retrying every case he touched at that department let alone previous ones.
Do you let a rapist go because someone becomes addicted to pain pills from a back injury?

The chief? Still doing nothing despite being legally bound to.
The city won’t replace him until he costs them too much money or they are held accountable for his inaction and are held liable.
It would make them look bad, they chose him.

There is nothing simple in LE, nothing cut and dried.