It's blindingly obvious if you read the whole story. It's nothing to do with race. Bregazzi has 90 previous convictions over 13 years. Clearly she has not learned a thing from all those sentences, she continues to be a rude, violent thug and committed the latest offences while on probation. Of course the judge imprisoned her. Nothing less would do.
Gallacher, on the other hand, had no previous convictions and showed remorse. A community order was therefore appropriate and proportionate.
I'm not reading and researching all those details about those particular cases. In general black people tend to have more prior convictions, they resist arrest, are rude to the officers, and don't take plea deals. They have a mistrust of the justice system as well as a fundamental misunderstanding. You aren't fighting for your life when you get stopped for a chat when you're smoking weed in the park. You are if you then shoot at the officer.
Because they are more apt to offend. Because they do not change their behavior easily. Because blacks have stated their hatred of cops (in America "we want dead cops"). Because there might be more to the story.