Yes they also do essential work.
In the natural pre-civilized state of things, people did bad things out of selfishness and greed just because they can. Like, one comes upon a weaker caveman and murders him to take his food or tools or whatever.
We tell ourselves our society is way beyond that. But at the end of the day it's actually still about force and violence. The only way to end corruption like this is for some very efficient and morally upright 'Boy Scout' to be put in charge of reforming these departments. They scrutinize everything and terminate everyone responsible. That sometimes happens, but also, doing that is very dangerous and makes a lot of enemies. To the point they get death threats or maybe even not just the threats. Because the ones doing the scams are willing to use force, and if we're being honest, strong bullies in numbers are still a force to be reckoned with.
Police unions often resist head count increases if it eats into the overtime scam. And zero cops are "forced" into this, but it's one of the biggest piggy at the trough scams going.
Further, police are just shockingly, unbelievably unaccountable for often being profoundly terrible and completely incompetent at their jobs. Budgets and headcounts keep exploding -- it is usually far and away the #1 cost for local budgets -- while the often far-right police force intentionally doesn't do their job to make some sort of statement.
Adding funding and number of cops, it turns out, is almost meaningless, and instead crime just fluctuates on other society macro elements.
I am not a defund the police person, but policing is at the very top of institutions that needs an extremely close investigation and retooling, being torn down and rebuilt on new foundations if necessary. If police were held to the efficiency standards most of the rest of society is, we would have an infinitely more capable policing system at much lower cost. Instead we have lazy, inept cops who intentionally do a shit job because it earns them overtime, and also sticks it to that "lefty" mayor, etc.
And for the "put their lives on the line" people who invariably drop their rhetoric as a diversion -- https://www.ishn.com/articles/112748-top-25-most-dangerous-j... -- dangerous, but if you aren't also hero worshipping delivery drivers, garbage collectors and roofers, maybe tone down the nonsense.