Loyalty is a difficult concept. I've been thinking about the subject since this morning. I'm not sure why. I must have heard a crime story on the news and wondered whether someone was protecting the criminal out of some misplaced sense of loyalty.
I think that fairness trumps loyalty. If one's friend causes harm to someone else, one may still have obligations to that friend (easing their pain, getting them help, etc.), but one doesn't have an obligation to obstruct justice in the name of friendship. It's a simple application of the Golden Rule.
This isn't to say that there's no gray area. If the misdeed is small and its harm is diluted over a large number of people, one doesn't have to peach to the peelers about the infraction. However, one does have an obligation to take some corrective action. Even minor offenses may warrant a hard stare.
I'll stop here lest I write a 12-page manuscript on the subject.