Humans are amazing at justifying actions. There's a whole school of ethical thought devoted to it (utilitarianism).