Sensible applications of loyalty are a two way street - are they paying you fairly, are they developing you as a person? If they're not investing in you, being loyal to them is just stupidity. Match your commitments, that way if they stop you're not left going - "But I gave you everything and now I've got nothing!"
Your allies and your friends don't weaken you or leave you to rot. Anyone who does isn't worthy of your loyalty.
I've been laid off before, I didn't feel bad about it - I was loyal to them and they were loyal to me, and when the relationship ended we went our separate ways, both the richer for it.
I am all for being loyal to a company. However, I also think that the fact is....
I have watched "layoffs" at two big tech giants (only one was called that) and watched what happened to the people who left and the people who stayed. In general I have found that despite the uncertainty it is actually a good thing, on average, to be laid off. Earning power seems to go up, and people move into more challenging jobs. THose who remain tend to be part of a more ossified corporation and with less mobility.
Your allies and your friends don't weaken you or leave you to rot. Anyone who does isn't worthy of your loyalty.
I've been laid off before, I didn't feel bad about it - I was loyal to them and they were loyal to me, and when the relationship ended we went our separate ways, both the richer for it.