They cared in Afghanistan and they will care now. The days of Stalinist Russia are long gone and Putin, try as he may, cannot take Russia back.
Afg doesn't matter to Russia like Ukraine does. There are several HUGE national security issues for Russia with Ukraine.
Ukraine possibility of joining NATO would mean a land invasion vector perilously close and indefensible to Moscow.
Ukraine fossil fuel exploration has uncovered reserves so vast they directly threaten Russian exports which are crucial for their economic stability. Western fossil fuel companies building refineries, extraction has been a ticking time bomb on Russian retaliation. This is also directly linked to Ukraine NATO membership. Russians can't sabotage Ukraine facilities anywhere near as easily if Ukraine is under the protection of NATO.
You want to see how this all makes sense - go look at what Russia did with Crimea and why. What deposits were suddenly under the Russian umbrella when Crimea was taken particularly to the west of the Crimean peninsula. HUGE reserves - Russian economy threatening scale.
Now yes Putin is committing war crimes. But several western leaders identified this scenario DECADES ago and the West slowly surreptitiously moved to this endgame. That NATO encroaching on Russian borders was inevitably going to "force" this response.
Both are situations Russia would possibly throw ALL their resources at preventing. I mean there may be no limit to how far they escalate to stop these - not if the alternative is economic collapse. We are talking about a super power choosing to collapse or not.