The Soviet-Afghan War was viewd much the same way as the US-Afghan War was later in its years. It was a war in a strange country that many Russians were losing their lives in, many to sickness and non-combat related deaths due to bad hygiene (hand sanitizer wasn't developed yet for example).
It differed largely due to the 9/11 attack on the NY World Trade Center by Al-Qaeda mastermind Usama bin Laden. America was there for revenge and to get rid of the rats nets of Al-Qaeda and their Taliban supporters.
Russia went there for its last formal military intervention before it collapsed. It went on orders from the KGB to replace Hafizullah Amin with the Soviet backed Babrak Karmal as head of the Democratic Republic of Afghanistan. Afghanistan was a more liberal country that was in turmoil due to the unpopularity of Amin. It was under threat of radical Islamization and being influenced by the West. This was a slow build up to war though, with the USSR being involved in Afghan politics since 1978. The Politburo saw that the earlier, less "hard" approach to influence Afghan politics wasnt working and they decided to invade.
They convinced the Soviet government to invade by asserting that Amin was a CIA American agent.
By the time the Russians left Afgh., the Russian people were very tired of the war though.
-A good book on this and the experiences of the officers and soldiers there is The Bear Went Over the Mountain.
Edited for formatting spelling grammar