When uniformed thugs are tried for crimes, they ask to be tried by a judge with no jury, because they know judges are likely to find them not guilty.
People who work in the criminal justice system often need the cooperation of thugs. For this reason, some prosecutors go to extreme lengths to protect uniformed thugs from prosecution. Nowadays some prosecutors do prosecute thugs, but I expect that many of them still try to protect thugs.
I expect that judges also want the cooperation of the thug department and therefore are under pressure not to put thugs in prison, even when they deserve it.