The police were not created to protect and serve the population. They were not created to stop crime, at least not as most people understand it. And they were certainly not created to promote justice. They were created to protect the new form of wage-labor capitalism that emerged in the mid- to late-19th century from the threat posed by that system’s offspring, the working class.
This is a blunt way of stating a nuanced truth, but sometimes nuance just serves to obfuscate.
Before the 19th century, there were no police forces that we would recognize as such anywhere in the world. In the Northern United States, there was a system of elected constables and sheriffs, much more responsible to the population in a very direct way than the police are today. In the South, the closest thing to a police force was the slave patrols.
The violence the police carried out and their moral separation from those they patrolled were not the consequences of the brutality of individual officers, but were the consequences of careful policies designed to mold the police into a force that could use violence to deal with the social problems that accompanied the development of a wage-labor economy.
For instance, in the short, sharp depression of the mid-1880s, Chicago was filled with prostitutes who worked the streets. Many policemen recognized that these prostitutes were generally impoverished women seeking a way to survive, and initially tolerated their behavior. But the police hierarchy insisted that the patrolmen do their duty whatever their feelings, and arrest these women, impose fines, and drive them off the streets and into brothels, where they could be ignored by some members of the elite and controlled by others.
The police were created to use violence to reconcile electoral democracy with industrial capitalism. Today, they are just one part of the “criminal justice” system which continues to play the same role. Their basic job is to enforce order among those with the most reason to resent the system—who in our society today are disproportionately poor black people.