Trading the Soviet Union for the Taliban was like trading stage 4 cancer for a bad cold. Even if one could perfectly foresee the results, it would have been criminally negligent to fail to do so. Trading an existential threat for a non-existential one is always a good deal.