I argue the opposite. Like if my friend told me he got a bunch of roofies to rape some chicks at a party I don't think I have any obligation to protect him. Or to be more grounded, if a buddy showed me his gun and said he's off to rob a 7/11 calling 911 is better than just shrugging and saying "whatever man, you be you." Loyalty only goes so far.
In this sort of situation, if you want to be morally spotless about it, I suppose your best option is to attempt stopping him yourself. Which wasn't really an option for Taylor at the time.
So morality isn't based on any code of behavior but instead on personal relationships. That's horrible.
That's exactly how morality works.
You can't treat everyone equally; the obligation you have to, say, your own child, is something you simply can't fulfill with regard to
everyone on the planet, it literally is not possible. Thus, morality consists in fulfilling the obligations you actually have, not the ones you might have if things had gone differently. By becoming friends with the Undersiders, joining their team, and agreeing to go along on the bank job, Taylor gained an obligation of loyalty to them, which she would lack if she was just a bystander with special knowledge. This obligation, being personal and specific, trumps the one she might have to hypothetical people who could possibly be hurt when she carries through. (And, hell, what about the people who might be hurt if she does lead them into a trap, and it devolves into an enormous cape fight? You don't get to write them off without notice.)
By contrast, what Mike Allen did in Security! — basically, he did trap the Undersiders, based on his outside knowledge — is just fine, since he did not have any obligation to respect the Undersiders' trust.