I don't think that any one would dispute that a number of radical terrorist groups use Afganistan for training, part of the object of being in Afganistan is to disrupt the operations of these groups.
The choice is simple, take the battle to the terrorists and fight in Afganistan or have the terroists bring the battle to the streets of Europe & the USA.