Exactly one can't - this war IMO isn't just about NATO via Ukraine being at Moscow's doorsteps.You can't seperate the economic and political implications from territorial gains. Putin's regime can claim to a domestic audience that they won because the borders of Russia have moved, but there is no scenario at the end of this in which Russia emerges as a more powerful and wealthy nation. Russia has torpedoed any hope it had at a prosperous future because it gravely miscalculated how the war would play out.
It is about Ukraine's vast wealth of natural resources, incl. it's population - if exploited solely by the EU and the USA it would mean effectively the end towards Russia's economy, or at least Russia's economy sinking into irrelevancy. (Something that the USA and some others are clearly looking at, or actually want to happen).
If handled in a professional manner (getting rid of it's corruption practices and other issues) Ukraine could actually develop into the 2nd or 3rd largest economy in Europe within 20-25 years.
As such - sorry to say; Even a nuked out and environmentally destroyed Ukraine = benefit and survival for Russia.