This outcome was 100% certain, merely a matter of time.
The west fails to understand, or refuse to, that this type of countries will never have stability or democracy in a long run. They are not really countries in the modern sense, borders on a map and a flag doesn't make a country.
3 requirement to guarantee a failed country are: being Multi-ethnic, tribal and poor. 2 usually enough, Afghanistan checks all 3, next.
In this case and as many others, Islamic extremism isn't the cause, it's the effect.