This planting drugs and lying is not necessarily because individual cops are racist and hate Black people. Instead, it's the inevitable result of a system that says "Make a bunch of drug possession arrests of Black people!" when Black people don't possess that many drugs.
There's dissonance between the mythology that Black people possess a lot of drugs, and the reality that they don't. In this racist system, the mythology wins.