or was it all just political? It seems like quite a war to wage for politics alone, so I'm wondering if there were any other hard benefits to having Afghanistan in their sphere of influence. Could it have been partly topographical in nature?
Edit: It seems the Soviets were aware of the significant mineral resources there but I'm having a hard time understanding how anything aside from copper would have been critical to them.
Much of Russia's history is trying to get access to a warm water port. Russia first attempted to use Afghanistan as a route to the sea in the 1800s, which raised tensions with British India.
The more recent reasons to intervene: the USSR was losing influence in the Middle East (Egypt and Iraq mostly) and had good relations with Afghanistan and the socialist government. Preserving an ally on their southern border, particularly an Islamic ally (history repeats itself in 2016!) would allow them to expand their sphere of influence.
While Afghanistan does have significant natural resources, I don't know that there was anything that they didn't already have access to in USSR proper, however this last paragraph is purely conjecture.