There are many specific moments, as well, where loyalty plays an important role:
Arabella Figg is loyal to Dumbledore, and thus keeps an eye on Harry, even though it is the job of Mundungus Fletcher. Fletcher, who does not know loyalty, leaves his post, causing Harry to get attacked. Without Mrs. Figg, Harry would have no witnesses to the Dementor attack and would have been expelled.
Kreacher, the Black house elf, is another example of anti-loyalty. He is tied to the house because of the charms upon him, but he is not loyal to Sirius. Therefore, when Sirius messes up, and tells Kreacher to "go", Kreacher is able to twist his words and leave the house. This moment is a turning point, because Kreacher joins up with the Malfoys, to whom he does feel loyalty, and eventually is able to mislead Harry and cause the stand-off at the Ministry that lead's to Sirius' death.
Loyalty exists in the relationship between Sirius and Harry. Sirius has become Harry's protector because of Sirius' relationship to Harry's parents (his loyalty to Lily and James). Harry becomes loyal to Sirius - often getting angry when others make any comment that could seem critical of Sirius, no matter how true - because of the affection Sirius shows toward him. Their loyalty brings them both to the Ministry. Although it leads, in a way, to Sirius' death, Rowling shows us in many ways that loyalty is still a positive trait.
Snape's loyalty is another great example. He hates almost everyone in the Order of the Phoenix, especially Sirius. However, his loyalty to Dumbledore causes him to set actions in motion that bring the Order to the Ministry and to the rescue of the D.A. group.
Umbridge, wretched woman that she is, is loyal to the Ministry. So loyal, in fact, that she is willing to break the law and release Dementors on Harry in order to remove him as a threat to the Ministry's credibility. She is also so loyal that she considers using an unforgiveable curse to get information on behalf of the ministry.
One more example of anti-loyalty. Cho Chang's friend Marietta is not loyal to the D.A.. Her disloyalty causes Hermoine's hex to disfigure her face, and it also causes the removal of Dumbledore as headmaster.