Suppose a close friend of mine is accused of a capital crime. The case against my friend is extremely strong, indeed strong enough to convict him, except for one thing. My friend was with me when the crime was committed, at a location far from the crime. I am the only witness to this fact. My innocent friend's life depends on whether I am believed when I say that he was with me at the crucial time.
Now, suppose I am the sort of person who would lie to save an innocent close friend from execution. Then my affirming the alibi is worthless. If, on the other hand, I am the sort of person who is known to refrain from lying even if it were to save an innocent close friend from execution, my truthful witness may save my friend. And if I am a loose cannon, with it not known whether I would or would not lie, my witness may or may not be sufficient.
So in cases like this, there is a significant benefit from being the sort of person who is known to refrain from lying even if an innocent friend's life is at stake.
Of course, such cases are rare and extreme. But so are cases of the sort brought up by the defenders of lying. It is very rare that one is hiding Jews and Gestapo officers come and ask whether one is hiding any Jews. Most of us aren't hiding any innocents from unjust law enforcement (it may be different for readers of the blog in repressive countries--my heart goes out to any such), and few unjust law enforcement officers bother to ask if one is hiding an innocent except in order to have another charge against you if you say "No" and they find you were lying after searching your home anyway.
This makes it plausible that having a character willing to lie to save an innocent life is not actually beneficial in terms of saving lives. Or, at least, it is far from clear that it is beneficial--while the benefits of being known for unwavering honesty are significant (think of how one's letters of recommendation get treated).
Objection 1: What about another sort of case, though? You know your friend is innocent because you know his character in ways that won't convince the court, but he has no alibi, so you make one up. Aren't cases like that just as common as ones where you're the only witness to his innocence?
I don't know how common such cases are. But I think people's judgment of their friends' innocence tends to be flawed when that judgment is based on character rather than on eyewitness observations. So a willingness to make up alibis for people whom one thinks one knows to be innocent is not a good thing to have.
Objection 2: Perhaps one could have a character known to be willing to lie to save an innocent's life, except under oath. Such a character would be good enough to save one's friend's life.
Maybe, but not always. It might well be that it's really important to keep one's friend out of court altogether (maybe the local court is likely to be biased against him), and hence to convince the police of one's friend's innocence before the matter comes to court. And one doesn't want one's friends to have the experience of being tried for a capital crime.
Furthermore, in practice it may be hard for third-parties to know what one would or would not be willing to do under oath. Most of us are very rarely under oath. People's judgments of our trustworthiness under oath are going to be based on our trustworthiness not under oath.
Besides which, Jesus tells us to behave without an oath just as we would under oath, or so I read the following:
But I say to you, do not swear at all; not by heaven, for it is God’s throne; nor by the earth, for it is his footstool; nor by Jerusalem, for it is the city of the great King. Do not swear by your head, for you cannot make a single hair white or black. Let your ‘Yes’ mean ‘Yes,’ and your ‘No’ mean ‘No.’ Anything more is from the evil one. (Matthew 5:34-37)