I think everyone needs to keep in mind that fact that we invaded them. Fair enough we did it to route out the Taliban (somewhat of a knee-jerk reaction to 911 but that is what that is at this point).
However, we did NOT declare war on the Afghanis as a whole (nor them on us). So keeping that in mind, yes we need to avoid civilian casualties whenever possible and apologize (at the very least) when this sort of thing happens.
Lets reverse this a tad. There is a group here in the US that HATES some other country (for whatever reason, shouldn't need to look too far), they plan some attacks and pull off at least one. That country now rolls its military into downtown yourtown to route out the nare-do-wells without declaring war on the US as a whole, they just want the members of that group. Now, in the process, they send a missile through your front door by mistake, what would you want your government to do about that? What would you want your government to do 7 years later when they are still here and still killing your neighbors (albeit by mistake)?
Naturally a better solution would be to get out now before more blood is shed. The problem with the "War on Terror" concept that W got us into is the simple fact that no matter how many of these guys you kill there are a million more standing behind them ready to take up the fight. It will be never ending and it is unwinable.
This whole situation is a little reminiscent of Hitler invading Russia in the winter. Napoleon failed, what made Hitler think he could win? Well the Brits and Russians failed in Afghanistan over a 200 year period, what makes us think we can win? As always, history should be looked at a little closer before jumping in with both feet.
For the now, it seems we are stuck with this situation and this is simply a side effect, unfortunately a necessary one. The only real solution here is to pack up our toys and move back to our sandbox.