In the world of philosophy, there are two prime schools of thought about action and consequence.
One, laid out in detail by Immanuel Kant, is deontology, a theory in which the goodness of an act is judged solely by adherence to a rule or set of rules. There are universal duties and obligations, and it is the motive of the actor that matters.
In the second, teleology, determining whether an act is morally right or wrong depends solely on the results of said act (good results, good act; bad results, bad act). In this sort of pragmatic ethics, the ends justify the means — always.