Elected Sheriffs anecdotally seem to be at higher odds of being charged with corruption and are often focused on politicking rather than policing.
1. https://www.nytimes.com/2017/12/14/us/ana-franklin-alabama-s...
2. https://www.postandcourier.com/opinion/commentary/commentary...
3. https://apnews.com/afa9172c457725c92dcb39aca9c85a49
The issue may also be exacerbated if the electorate is actively okay or willing to ignore the corruption.
I believe the increasing political nature of the position is, in fact, part of the issue. The influence of politics through Mayors and the Police Unions makes running a department efficiently and effectively an impossible task if you want to hold onto your job. A chief of police either spend all of their time appeasing politicians by implementing their ideas for how to police effectively or are replaced by someone who will. At the same time they are receiving constant push-back from the Police Union. Never mind the years of experience, training, and graduate degree work almost all police chiefs have endured; they either do what politicians think they should do or are replaced. If they lose the confidence of the Union the Union will sabotage them and they will be replaced.
The second major issue, as I see it, is how we select and hire police officers, which still, almost universally, relies on the polygraph test. The polygraph is proven pseudoscience, but the actually effectiveness, I suspect, is irrelevant because the goal is to see if prospective hires can take the pressure of the test; not to detect dishonesty. You either get perfect applicants, or those who are okay and comfortable with lying.
There are many more issues, of course: the increasing militarization, some departments actively rejecting high IQ candidates, low pay and long working hours for patrol, etc.