Mhm, I agree, lying to protect someone isn't the best thing to do. As we both know, (in this case, it was failure to keep something a secret and then saying you did that to protect someone, but it all relates) it isn't the best thing to do. Whether it be for the smallest thing, such as saying you didn't sneak on the computer in 35 degree heat (which I'm guilty of), to a big thing such as stealing someone's bank card (with someone... being a friend and you using the money for your own pleasure), lying isn't the best. This is because in one way or another, someone will realise the deceit and one simple thing done for the good of someone will unravel and turn into something that you never wanted to occur.
However, honesty isn't the best policy either. When telling someone of the initial occurance, the reaction wouldn't be worthwhile. This leaves the dilemma of what is right in the first place; attempting to break the trust of someone or lying to cover up something when the truth about it is probably better. Though the aftermath caused by telling the truth may not be worth having a clean conscience. All in all, lying is best, but only depending on the situation at hand.