USSR had dozens military bases abroad and none of those countries was annexed (same as US still has abroad bases, but it does not mean annexation). USSR had no plans to annex Afghanistan but it had to defend socialist government against Pro-Western "Jihadist" forces. Millions of Afghani, mostly living in cities still remember USSR as good friend because we created education, industry, medicine and other things in there.
If we have not killed dozens or even hundreds thousands terrorists in Afghanistan in 80's the whole Central Asia, Caucasus and Middle East today would be like Libya, Somalia, Afghanistan and so on.