The quesion is based on a misconception: that police generally ARE racist. But a little research shows that black cops are perfectly willing to mistreat or even kill other black people, and that cops of any color are likewise willing to mistreat/kill poor white people. That suggests that the problem is in fact the general attitude of cops towards the civilian population.
The appearance of racism is mostly due to cultural factors, which might be the product of past racism in society. Black people, particularly poorer ones, are likely to live in mostly black urban neighborhoods where they are likely to frequently encounter cops. OTOH, many poorer* white people tend to live in more rural areas, and so can go years between encounters. Thus if the numbers of poor blacks and poor whites are equal, and there is the same probability that a given cop/civilian interaction will turn out badly, the resulting numbers will APPEAR to be caused by cops' racism, even though they're not.
*Like any bully, cops prefer to pick on those they perceive as weak.