I too was that loyal friend who couldn't understand why others walked at such an awful time, and was fiercly protective, so I hope you will think about what I'm saying here, because I'm trapped now, not by them, by me.
I have supported my very unwell friend, ‘B’ almost every day, for the last few years, while everyone’s fled, flounced or walked.
She suffered very real tragedy includeing two suicides, which fragmented her, but also covered up the fact she had serious prior mental health problems that 'aided' those tragedies to happen.
The last person propping her up, (who was my friend and I miss) had helped cover that up, then couldn't cope any more and killed themselves. I can't tell you how much I wished they'd just walked! B's hatred of them and determination that I (and others) must eradicate anything but negative judgement of them, has lead to B making up a lot of things to try and make it unnaceptable to miss them, and has pushed me beyond reason at times.
I'd have stuck by B anyway, but not knowing that their problems went way beyond what had recently happened, I thought I could help, because trauma is always going to make a bit of a mess of us, and other's can sometimes help lessen it, or at least give a safe space to survive it in.
Now knowing what I know, maybe in some ways I can, B's very slowly made progress, (though doesn't agree) but from a starting point of -30,
but they're deeply unhappy every day, insist it's my fault they're alive and suffering, constantly try to manipulate me, and the cost to my life has been very high, and the recipricatrion low.
B's lost all their old friends and familly after deciding if they don't accept, allow and agree with very unreasonable and often hurtful behaviour and do things exactly the way they want them done, then really they are enemies, and that's the real reason why B isn't ok.
They’ve now walked from me too because B get’s unreasonable if they think there’s any contact between me and people B’s declared the enemy and therefore to blame for B’s feelings. They warned me, but I didn’t hear it.
They think B will break me and they'll have to deal with it. B thinks "they're trying to take you off me." I find both views yucky.
HCP professionals say the type of problem B has, and their circumstances, is untreatable (though I read different on here!) and to call the rspca to remove the animals (that are often keeping B going) then I can apparently reasonably step away and let B kill themselves, as "it’s a case of when not if" and B will take everyone down first and drain money from the MH system. Actual words were " Treating B would be a bottomless financial pit." 
I know I'm being stupid and have been sneered at for it, but I’ve made the decision to try and stick it out partly because there’s also an awful lot of animals involved who will be un rehomeable, partly because I promised I would, and partly because I do actually care, and I still can’t believe that the official advice regarding someone with MH problems centring around a belief no one cares and a fear of abandonment, is to abandon them! It sucks.
But, my would be loyalty, lead to a very unhealthy situation I let develop, and I know it. I often feel trapped and guilt ridden for conflicting feelings over it all. I just wanted to keep my friends head above water, and later, get an equal friendship back, and I doubt I'll get that, so if I'm honest what's in it for me? I'm chucking part of my life away really.
Maybe I'll get let of the hook as altruistic, but I suspect the world will judge it differently.
I really really hope B gets better and has a future, and can learn to enjoy life, but you know what, if they do, I'm apologising and running, while they're well enough that I reasonably can!
What I now know is if another friend developed extreme MH problems, I would try and be there for them, and would go the extra mile, but I would lay down very strong boundaries, and if necessary walk away. I'm very loyal by nature to my friends, and never would have thought I'd say that.
Maybe those friends have been where I am now, and where you may find yourself, if you don't lay down the right boundaries while trying to be loyal. Don't judge them, wonder what it is they know, that you don't.