loyalty is earned
For me, it’s not even that. Loyalty is not owed, nor is it earned. It is nothing more than a description of behavior.
Think of it this way: I always do my grocery shopping at Target instead of Walmart, even if I see that something is slightly cheaper at Walmart I’ll still most likely go to Target for it. Some might see that and say, “Look, he has loyalty to Target”, assuming that I shop at Target because I am loyal to that brand. But that’s backwards. Really it is that I can be described as ‘loyal’ because I consistently go to that brand. ‘Loyalty’ is a description of the behavior, not the cause of the behavior.
it can be used against you
Only if you have bought into the coercive bullshit that ‘loyalty’ is itself a reason to do something. Employee or customer loyalty is nothing more than an observation that people consistently support the company. That loyal behavior is seen because those people consistently have reasons to support the company. If you observe that people are loyally supporting your company, that is because they have reasons to do so (for example, you might be paying them to show up and do shit. Or maybe they think the shit they are doing is important or fun).
People who want something from you for less than it is worth will try to convince you that loyalty is something you owe them or that they have earned from you because if you believe the lie that loyalty is a reason for action that makes it easier to get you to give them something for free.
No, I agree that allegiance is a behavioral motivator, but I think it is distinct from loyalty and that people tend to conflate the concepts (similar to how people sometimes conflate or confuse infer/imply and borrow/lend).
Loyalty, a behavior, can be observed; allegiance, a commitment (maybe supported by emotion, maybe not), cannot.