Your comment covers the gamut of ethical theories. A 'code of ethics' is going to be some combination of deontology and virtue ethics and will typically prohibit cases like this post describes.
> In many ways what they did was unethical but the result was probably positive overall.
And that kind of thinking is the other, newer branch of ethics: consequentialism/utilitarianism.
My conclusion is that deontology and virtue ethics are necessary heuristics as actually calculating or estimating the consequences of any action are almost always effectively impossible, but, ultimately, what we care about are exactly those consequences, so we're never able to adequately 'cover' morality without, at least sometimes, explicitly considering them.