I'm of two minds on the subject:
Mind #1: Your relationship with your company is like your relationship with any other person. You build trust or lose trust over time. A bad break-up will make you think you'll never find a good relationship again. A callous firing will do the same. Every relationship is different just as every company is different. Loyalty can exist in the same way any good relationship can exist.
Mind #2: It's a freaking job. The higher-ups are always going to be making decisions that have little or nothing to do with your inherent value. You have just got to roll with the punches and keep fighting. Loyalty is just another word for fulfilling the terms of your contract. No more. No less.