The Taliban were accomplices to Al-Qaeda in the 9/11 attacks. If this war was not justified, then almost no war would ever be justified.
Furthermore, the US wasn't the only country that attacked Afghanistan. The coaliton included:
Canada
Australia
United Kingdom
New Zealand
France
Germany
Russia
Italy
The Netherlands
Denmark
Norway
Croatia
Czech Republic (aka Felonies!)
Bahrain
Jordan
Japan
Portugal
Poland
Romania
Among others. NATO and the UN have also been involved.
The war was pretty much universally legitimized.
I totally agree that elements from other countries were complicit in the 9/11 attacks. For example, most of the hijackers were Saudi Arabian. But the response to every country couldn't have been the same. Attacking Egypt and Saudi Arabia post-9/11 would have been asinine given the US relationship with these two countries (however suspect said relationship(s) may be [especially with Saudi Arabia]).
With respect to civilian casualties, they are horrible. The use of bombing and so-called "collateral damage" is always troubling to me. I don't know enough about military operations to know if the war could have been conducted with fewer civilian casualties. There have been pretty serious humanitarian efforts since the invasion, though, by both the UN and the US. It seems like valid criticisms can be made of the war's effect on civilains.
Not sure what you mean here.
The US government/regime/administration did not provide funding to the IRA as far as I know. A few individual US citizens did. I think that's a pretty big reach for an analogy.
I don't mean to defend every decision that has been made in Afghanistan or to suggest that it has been a flawless war by any means. But there are no flawless wars. I believe that this was as close to a "good" war as you can get.