"The right thing to do." People always say that like it means something. Like it has some universal meaning or objective significance. The right thing to do is what produces the right outcome. The right thing to do is moment-to-moment. And you know, superheroes will say that the appropriate metric for goodness is not based on some moral calculus, that there are objectively right and wrong actions, that virtue ethics or deontological ethics are superior to utilitarian ethics. They might even believe they live up to that. But the ones that do have their heads so far up their own asses that they can probably see sunlight.
It's particularly ironic to be chastised for lying by a bunch of superheroes with secret identities, you know? They say they're lying because they have to, but they don't have to. Nobody ever has to. They're lying because they think that lying is, in that context, for the greater good. They lie to preserve their lives, their own interests, the lives of their friends, and that's fine, that's good. I have no criticism for their choice to lie in that situation. But they then turn around and chide me for being deceptive, dishonest, or less-than-forthcoming in the furtherance of my plan, of my greater good. And they tell me that it's bad because lying is wrong. That there are moments when it is objectively wrong.
Bull shit. Now I will grant that the universal adoption of lying could ultimately prove problematic, in that it would render the truth meaningless. But the act of acknowledging that there are times when lying is good and appropriate is an admission that the morality of lying is relative. It is an inherently utilitarian exercise. It is an admission that lying is acceptable in the pursuit of the greater good.
To then say that an act is conclusively right sometimes and conclusively wrong other times is just... arrogance, really. It's the belief that you are uniquely qualified the determine the most appropriate moral standard in every situation. That your subjective views are superior, that your beliefs dictate universal morality. But your lie is not the only righteous lie. Your good is not the only good, and yours is not the only means of achieving that good.
As to your... subsequent, overarching point, however. I can certainly understand an appreciation for situational honesty and the trust that it signals they have for you. But communicating trust, I think, is more about vulnerability, of which honesty is only one (arguably nonessential) part. There are many iterations of trust, and many ways in which to exercise, communicate, and warrant it. I've never thought of honesty as being a necessary part of it. Trust, ultimately, is about knowing that someone has your back. That they aren't out to hurt you. The fact that you can't always believe someone doesn't mean that you can't trust them.
And as they say, you can always trust a dishonest man to be dishonest.