That's why I mentioned surgery at the end of my comparison with blade cuts. Much like cutting into a body is traumatic for it, but is sometimes require to save it, sometimes the ethical benefits of a lie far outweigh the costs. Yours is a very good example.
There are also more fuzzy ones. Since I mentioned medicine: there's an ongoing discussion in the medical community as to if and when lies by omission are OK - is there a point to informing the patient about something they can do nothing about, when if they learn about it, it would cause them great amount of emotional distress? Caring for health doesn't mean just servicing the body like a mechanic, but also catering for person's emotional well-being.
The point I was trying to make is that lies, by default, are bad things (much like being cut by a blade). Intent, care and consequences are what can make lies very bad, or - sometimes - good.