There is a strain of thought in Russian political circles that they'll be doomed anyway due to lack of defensible borders if they fail to capture Ukraine. This could explain some of their actions that otherwise seem irrational and counterproductive.
It doesn't seem to make any sense: nobody was invading Russia until Russia decided part of Ukraine was Russia (and then Ukraine invaded it), and why would Ukraine be a more defensible border than the actual border? Ukraine borders NATO, after all.
From the Russian perspective it actually does make a bit of sense, in a twisted sort of way. They were invaded from the west before, most recently by Hitler and before that by Napoleon. There are no good natural defenses to protect Moscow and so they seek to establish defense in depth with additional buffer territory. (I write this not to justify recent Russian acts of aggression but to explain some of their internal strategic thinking.)