Afghanistan is far more complicated than that. We didn't create the Taliban or Al Qaeda. Its likely they would have existed even without our putting funds into afghanistan.
And imo, the collapse of the Soviet Union (a mortal threat to the US) was important enough that I wouldn't change a thing in that regard even knowing what I know now.
USA/Afg/Osama Bin Laden v USSR = Fall of USSR = Al Qaeda/Taliban = 9/11 = No worries/USA win!