What happened to you was unfair as well.
The former supervisor of that employee had all the documentation was in that employee's file (errors that cost the company money, complaints from customers, excessive absences, counseling sessions, write-ups), yet her supervisor was forced to give that employee a raise, then promote her because that employee was liked by management despite her poor performance. Yes, she was Caucasian.
I myself had an underperforming employee who was always late to work, late on completing projects, behavior that was considered sexual harassment, and insubordinate. I documented all of that behavior and I was also forced to give him a raise, because he too was a favorite. And yes, he looked Caucasian but people didn't know his mother was Asian.