When King Saul sentenced Ahimelech and the other priests to death, Saul's soldiers refused his order to kill them. It was obvious that the priests were innocent of any plot to kill Saul. Doeg, knowing that the priests were innocent, obeyed Saul's order to murder them.
Doeg was what some Christian leaders want--on the outside. He obeyed orders blindly, ignoring the fact that they were wrong. But Doeg's "loyalty" didn't come from Godliness. Doeg had "set up" King Saul to murder the priests, and Doeg's loyalty was the result of evil, not good.
Don't ever show that kind of loyalty to a person. Get fired, get demoted, get slandered, get expelled, but don't ever show that kind of loyalty to a person.