
Just like I would never tell my child that it is never okay to hit, I would not tell them that it is never okay to lie. Unless you're prepared to never ever lie yourself, and to denounce lying from others, your children will eventually see you as a hypocrite.

When they do get caught lying - as opposed to coming clean on their own - I try make them understand that the lie is worse than whatever it was they were lying about. (Fortunately this has always been the case.) In addition to whatever punishment seems appropriate for the context, I reinforce that I can no longer trust them, which is a struggle as a parent. I force myself to remind them how I now have to second guess what they tell me. I remind them that it will take a long time for them to earn my trust again.

Sometimes it can be very tempting to lie to your child. Like when they ask you a difficult question about mature content, or are seeking undeserved affirmation, or when referring to characters like Santa Claus, the Easter Bunny or the tooth fairy. While I think it is theoretically okay to lie to your children, every time we do so we set a precedent. We have to decide whether we're willing to risk our long term credibility with them.
When my kids ask me a tough question, or one I'm reluctant to answer, I always try to first ask them "why do you ask?" Usually they're interested in something much more specific than what I fear.
We can also use context to shield children from unwanted fears that might come from honest answers. When our children are questioning mortality after a tragedy I might explain to them that "we're all going to die someday and we never know when" or "sometimes bad things do happen, but they could happen anywhere, anytime. They're not any more likely to happen tomorrow than they were yesterday, so we have to keep on doing what we have to do."
For some questions I might even find it necessary to stall, like questions about my own past that I'm not ready to discuss. In a situation like that I might say something like "that's a good question and I need some time to think about it" to "I think you need to be a little older for us to really talk about that in detail."
An old friend once told me that your integrity is one of the few things you really own. Cherish it and teach your children to do the same.
On The Leonard Lopate Show the contributing editor for New York magazine, Lisa Miller, talks about ethical parenting, or how parents engage in behavior that is various degrees of corrupt on behalf of their kids:
There was a really good episode about Breaking Bad News To Kids on Talk Of The Nation that touched on this: