Catechism of the Catholic Church
1753 A good intention (for example, that of helping one’s neighbor) does not make behavior that is intrinsically disordered, such as lying and calumny, good or just. The end does not justify the means. Thus the condemnation of an innocent person cannot be justified as a legitimate means of saving the nation. On the other hand, an added bad intention (such as vainglory) makes an act evil that, in and of itself, can be good (such as almsgiving).39
1754 The circumstances, including the consequences, are secondary elements of a moral act. They contribute to increasing or diminishing the moral goodness or evil of human acts (for example, the amount of a theft). They can also diminish or increase the agent’s responsibility (such as acting out of a fear of death). Circumstances of themselves cannot change the moral quality of acts themselves; they can make neither good nor right an action that is in itself evil.
1759 “An evil action cannot be justified by reference to a good intention” (cf. St. Thomas Aquinas, Dec. praec. 6). The end does not justify the means.
Re: Double Effect.
2263 The legitimate defense of persons and societies is not an exception to the prohibition against the murder of the innocent that constitutes intentional killing.
“The act of self-defense can have a double effect: the preservation of one’s own life; and the killing of the aggressor. . . . The one is intended, the other is not.” 65
65 St. Thomas Aquinas, STh II-II,64,7, corp. art.
2268 The fifth commandment forbids direct and intentional killing as gravely sinful. The murderer and those who cooperate voluntarily in murder commit a sin that cries out to heaven for vengeance. 69
Infanticide [killing of an infant], 70 fratricide [the killing of one’s brother or sister.], parricide [the killing of a parent or other near relative], and the murder of a spouse are especially grave crimes by reason of the natural bonds which they break. Concern for eugenics or public health cannot justify any murder, even if commanded by public authority.
69 Cf. Gen 4:10.
70 Cf. Gaudium et Spes 51 § 3f