"I have loyalties that are greater than those to my party."
—
Loyalty: Etymology and semantics
The word functioned in the special feudal sense of one who has full legal rights, a legalis homo being opposed to the "outlaw". Thence in the sense of "faithful", it meant one who kept faithful allegiance to his feudal lord, and so loyal to the ultimate temporal power.