Maybe. Killing or stealing for a reason doesn't make the action morally good, just less morally bad than the outcome it was intended to prevent. I've never heard the first parenting example.