Czechoslovakia was carved up by the Nazis with the assent of most of the civilized nations of the day who agreed that it was the best thing to do for world peace. That wasn't the last time such a thing happened and we keep witnessing repetitions of that horror over and over again.
International law is neither international nor law. It is not consistently applied, and therefore isn't law. It is not international as the majority of the world does not subscribe to it, despite signing agreements to the contrary. What we call international law is not a judicial process, but a political one, an extension of existing international and national power structures which is selectively used to justify their actions.
And even if all these were true, process does not make right, it only achieves a consistent result or a consensus. It cannot tell you whether a course of action is right, only whether it came through the same sausage factory as every other decision did. The sausage factory process achieves a certain amount of consistency which is the next best thing to fairness, it does not however make a thing just.
A just war has nothing to do with multi lateralism or getting a vote through the UN Security Council where the butchers of Beijing rub shoulders with the pet representatives of Vlad the Impaler.
The wars we fight may be roughly divided into three categories.
1. Defensive wars - These are wars fought in response to an attack or a planned attack. They may be fought preemptively to deny a known enemy an advantage, whether it is a weapon or territory so long as it occurs within the context of an existing conflict, whether overt or covert.
2. Moral wars - Wars of aggression fought to prevent another nation from carrying out some unspeakable act such as genocide.
3. Interest wars - These are wars fought primarily to protect commercial interests, maintain regional stability, improve the position of an ally or otherwise alter the map in your favor.
Obviously there is a certain amount of overlap between these three types of conflict. Nations are run by people and people do things for complex reasons. Interest wars are often passed off as moral wars or defensive wars. Often wars have all three components with varying degrees of emphasis and sometimes one type of war turns into another type of war in the middle.
Most wars are primarily interest wars, because few leaders will launch a war from which there is nothing to gain. These gains however are not necessarily national or corporate in the crude, "No Blood for Oil" type of way. If the modern West still fought wars as simple as that, the price of gas would be much lower and Saudi Arabia would be an American colony.
Interest wars are not only wars of national interest, but wars of ideological interest fought to fulfill a goal embedded in an ideology. International law itself is an aspect of ideology. Wars fought in the name of international law are ideological interest wars, but at the same time they also often disguise lesser personal and national interests.
Afghanistan began as a defensive war that mutated into an interest war when it became a nation building exercise. Like most modern interest wars, it was not in the interest of the United States, but of the towering framework of global stability and international order which was primarily concerned with the management of chaos and the progress toward global order.
The ideology of international law assigns legitimacy only to those conflicts between the international community and a rogue state. In two sided conflicts, the "international community" chooses a side, offers a prescription and the other side is given a choice between complying or being denounced as a rogue state. When the fighting is over, the rogue state, deemed a source of chaos, is reconstructed as a good faith member of the international community.
America's defensive war after September 11 was wedged into that narrow formula. We came as liberators, then we settled into the old task of winning hearts and minds, counterinsurgency and bringing stability. All wastes of time. To defeat a guerrilla group, you either need to tackle the civilian population that it draws its support from, and this is usually an ugly business, or you have to go after its state sponsors outside the borders. Unless you do one or the other, the war becomes a long bloody business. If the guerrillas have enough outside support and recruits, it can go on indefinitely. You can win victories against them for decades without significantly changing the situation until you have wiped out or turned their leadership. And even that might not be enough.
The error began when our mission parameters demanded long term control of Afghanistan. Rather than inflicting as much damage on Al-Qaeda and its allies as we could, we began thinking in terms of denying them purchase in the region. Considering Pakistan's long history of support for Islamist terror, this was a clearly unworkable program. It was also meaningless. Al-Qaeda could set up shop in any number of places in the Muslim world. Afghanistan was ideal in some ways, but its members were not ethnically tied to Afghanistan. They weren't committed to it in an ethnic way, it was a base not a national identity.
That same error was once again repeated in Iraq, again operating on the same illusion that with enough commitment, we could stabilize a country and then a region. As in Vietnam, the local institutions failed us, forcing us to do all or most of the work until we were the only ones holding the country together. Perversely this worked against our goals of long term stability as the more we imposed an external structure, the less stable the internal structure became.
Had we not propped up Karzai so much, the post-Taliban Afghanistan might have evolved more naturally, instead it shaped itself around us, in a mostly negative way. Our money paid for it all and our troops provided the security. Those on the inside were not challenged, only those on the outside who learned, adapted and came back stronger than ever.
When our objectives shifted from destroying the enemy to denying him control of the territory by creating and protecting alternative political and military structures, we fell back into the same errors and shifted from a defensive war to an interest war, and from being on the offense, we fell back on the defense acting as beat cops for the state that we hoped to create.
If the Afghans were less corrupt and more civilized, things might have been different, but if that were the case, the Taliban would have never ruled in Kabul to begin with. If the Taliban had been weaker, then we would have lost fewer men and the Karzai regime might have had a future. But if they had been weaker, we wouldn't have had to go in because they would have never sheltered a terrorist group at war with the United States.
The final outcome was mostly inevitable. Rather than reshaping the chaos, we became part of the chaos, we shaped the chaos, rather than imposed order.
What had been primarily a defensive war, took a back seat to moral war and interest war elements which then became supreme. It was now a war fought to protect Afghans and the Afghan government and to assert the power of Muslim democracy and the ability of international intervention to heal sore spots, drain away the chaos and bring order. Even the term war hardly applied. Rather than a war it was more properly a guardianship, a long watch on the wall, not against Al-Qaeda, but against chaos.
American sacrifices to achieve these ends were out of proportion to the potential and actual gains making it an unjust conflict as it was operating against the interests of those fighting it. As a defensive war against an enemy, it had been just, but as a defense of an ideology and an enemy population, its pursuit had become unjust to Americans.