The Catholic Church sees no such contradiction. There are a few basic principles which allow us to find clarity in complex situations.
The first principle is simply the Law of Love, also known as the two Greatest Commandments:
"Teacher, what is the greatest commandment in the law?" And he [Jesus] said to him, "You shall love the Lord your God with all your heart, and with all your soul, and with all your mind. This is the great and first commandment. And a second is like it, You shall love your neighbor as yourself. On these two commandments depend all the law and the prophets." (Matthew 22.36-40)
Now, "Love" in the Christian tradition means much more than a nice feeling or an attraction or any such emotion. Love is an act, the most fundamental act of a person. It is to will what is good. Love delights in a good that is present, and pursues a good that is absent. The love of charity, the perfection of love to which we are called, seeks the good of union with God, which is the highest good, and the one that all persons share in.
In other words, to love God is to delight in his glory. To love myself is to seek union with God. And to love my neighbor is to seek my neighbor's union with God.
Now, this sounds very abstract and mystical, but it has some very practical implications. Perhaps most importantly, it shows us the priority of goods in the world. Everything God has made is good in itself; but not everything is good for me (or for my neighbor) at any given time. Things are good insofar as they draw us closer to God.
So, my physical safety and integrity are good things. Most of the time, being healthy and secure is a real help toward union with God. But there are times when my physical or social safety becomes an obstacle to union with God. To admit I am a practicing Christian at school or at work can lead to ostracization. To serve the poor and the sick risks infection or theft of my property. To refuse undue honor to Muhammad or to the Koran, in some parts of the world today, risks imprisonment, torture, or even death.
In other words, when even a good so important as my physical integrity is set against the good of God, the choice must be for God.
Martyrdom is not something we seek out for its own sake. It is something we endure only when necessity drives us to it. So, when possible, we try to hold onto both goods: bodily integrity and union with God. Under normal circumstances, these goods are not opposed to one another. Martyrdom - of any kind or degree - is not normal.
Now, if we love our neighbors as ourselves, then we will be concerned for their physical integrity as for our own. That is, whenever it does not conflict with union with God, we will seek to defend and promote their bodily good. In families, this means caring for and sticking up for one another. In communities, this takes both personal forms - such as intervening when you witness a crime in progress - to institutional forms - such as the police and military.
The whole notion of rights to self defense and just war are founded, in the Catholic tradition, on the law of love. They are legitimate rights, but they are limited because they are not ends or obligations in themselves; they are for the sake of union with God.
So, I do not have the right to defend myself by any means necessary. Rather, I have the right to defend myself insofar as I do not commit a sin in doing so. I can fire a gun at my attacker, even shoot to kill if that is the only way to defeat the attack; but I cannot poison him, or maim him, or use deadly force where lesser force is a real option. In other words, I may not commit murder, even to prevent my own murder.
Likewise, the State has the obligation to defend the common good, and so (as noted) has the right to detain and punish criminals up to depriving them of life. It has the right to maintain a military fighting force, and to engage an attacking enemy. But the State does not have the right to murder. It has no right to kill a criminal when other means of defending the common good will do; and it has no right to use military force when other options for defense are available. It has no right, ever, to attack a neighbor. The only truly just war is a war of defense.
This will make clear, I hope, the second principle, that we may never do evil, even for apparently good reasons or seeking good consequences. Murder, the deliberate taking of innocent life, is always and under any circumstances, wrong. For that matter, any deliberate attempt to harm another person in any way, that is, to act contrary to their good, is an evil act.
The second principle simply states that nothing supersedes or dispenses from the first principle.
Hopefully, this will make the theory usually called "double effect" more clear. Double effect is a last-resort theory for extraordinary circumstances, when no choice is an unmixed good. It does not permit anyone, ever, to choose an evil act under any circumstances. Rather, it acknowledges that there are times when, no matter what one does, something bad will likely result.
- First, I make sure what I am going to do is itself a good act; for example, I am defending myself and/or my children against an attacker
- Next, I see what possible evils could result; for example, I recognize that I will likely injure, perhaps even kill, the attacker; I also risk injury or death myself
- Finally, I make sure that the evil I risk or allow is not disproportionate to the good I seek; for example, if my attacker has a pocket knife, I don't respond with a 9mm
This principle applies to acts of individuals as well as institutional acts of governments. Morality doesn't change with size; only the means available change.
I hope this clarifies why, from the perspective of Catholic moral teaching, torture and abortion and euthanasia are always wrong; the death penalty, self defense, and defensive war must be used with extreme caution, if ever; and "pre-emptive" wars are inherently unjust.