The Church has unequivocally taught for millennia the Jus Ad Bellum, Just wars exist.
But at the same time, the Church has sought to limit State employed violence to a minimum and eradicate it if possible from private relationships.
So for example, while acknowledging a private person's RIGHT to defend himself or his family from a murderer, the Church teaches that it's never permissible for a private person to kill someone who is NOT an immediate threat to their lives. (i.e. no vigilante justice).
Ideally we ought to forgive and forget, or be martyrs, or flee from evil-doers. If we seek to avoid trouble but trouble comes to us, then we can fight back...but again, with maximum restraint...we can't go out and kill the troublemakers' whole clan.
Since at least the 400's and St Augustine's time when Christians began to run the state machinery and thus had chief responsibility for the common good, lay men and prelates have grappled with the thorny issues of how to maintain tranquility in the state (tranquilitas ordinis) with a minimum of physical violence.
Thus, among other things, war was heavily regulated..... in 900 or thereabouts, the Church proclaimed the "Peace of God" in Europe, where in since most kingdoms were either ancient Christian ones or newly converted ones, it was considered to be unseemly for one Christian king to fight a war against another.... since all were 'brothers' a peaceful settling of disputes was sought.
Naturally the 'peace' didn't last as someone always broke faith. So they rolled out the "truce of God" in around 950. This acknowledged that some bad guys will ruin the tranquilitas ordinis and essentially gave all his neighbors lee way to gang up to control the evil-doer and released the bad guys' own troops from their oaths of alligiance to him, since a criminal was seen as not having rights to be obeyed.
All this seemed to point to stability in Europe leading up to the year 1000.
But then the Moslems started invading the Eastern Empire around 1050 after a couple decade long truce... and the question again was made to Christians....what ought we do in the face of an unjust aggressor who will not negotiate a peaceful settlement?
From the Crusades to the present the Church has grappled with these concepts.... for example, MAD was considered immoral as it would doom the innocent to die with the guilty.
In the tradition of banning the "cry of havoc" (on pain of death, of course), the Church sought to ban the intentional targetting of old men, women and children, the wanton destruction of non-military targets, etc etc. things we take for granted in warfare actually have Catholic roots in the Just war tradition.
Throughout the history of thinkers of course you have some stupid ones. For example, at one point Bishops (though not the Church as a whole) sought to ban the use of the crossbow as unfair and thus immoral.... one could easily see a clergyman from noble stock being shocked that a commoner of no noble blood dispatching a mounted and armored knight with a cross bow bolt at 100 yards.... very unfair indeed.
Kind of like dispatching a $400,000 uparmored HUMVEE with a $25 RPG.
In the 1980's some clergy and bishops in the US came out in favor of unilateral nuclear disarmament so as to give the Soviet's "good example". But then their reasoning was more political and theological.
In the ramp up to the Gulf wars, many theologians and bishops decried any action against Saddam, advancing many dubious theories as to why any US action - even with the blessing of the UN - were 'illegal and immoral'.
Like the nobleman's clergyman though, their "reasoning" was more political than theological and thus, more a question of contingent opinion than binding on the conscience to obey.
In 2002 and 2003, for example Pope John Paul II mentioned the coming war with Iraq on about 2 dozen occasions but NEVER went longer than a couple sentences and even then never said that the war would unequivocally be immoral.
He did say the "use of modern weaponry (defined elsewhere in Vatican documents as Nuclear, biological and chemical) is always immoral as they inflict death and destruction on the innocent along with the guilty".
So had we nuked Iraq from orbit, carpet bombed all Iraqi cities to rubble, and then dropped bugs and chemicals to salt their earth.... it would have been immoral,.
But SINCE WE DIDN'T DO THAT.... the argument against the war falls apart.
He was trying to call for a diplomatic solution on one hand - however far fetched that was as a solution - and to limit by precluding certain tactics the damage on the other.
The usual suspects on the American and European Left who happen to be Catholic (Largely in name only, not theologically or morally) took what little he said about Iraq and conflated it to mean "the Pope is against Bush and therefore everything that happens post 2003 is categorically immoral and so a Catholic must be against the US foreign policy when it comes to the use of military assets....until such time as we get one of our guys elected when it will magically become OK".
There used to be a very useful website called "catholic just war" but its gone now.