How does he gain by wrecking Ukraine's economy? I see that as loss. Because he loses whatever little soft power he had with Ukraine. Ukraine will look even harder westwards for direction.
NATO was not keen on Ukraine, so he gains a "victory" at great cost that he already had for free. He probably is more worried about Ukraine joining the EU than NATO. A thriving liberal democracy on Russia's doorstep is bad contrast to the mafia state that is Russia.
His behavior also strengthens the Western alliance. The notion that Russia was a receding threat gone, they redouble their focus on NATO.
An economically weak Ukraine won't be able to arm and pose a threat to Russia first, it is useful tactic to scare other countries - we can destroy your economy just by amassing troops on your border thus paralyzing it. This is a grey area Russians excel in. They foment conflicts and freeze them. Russia thinks like a 19th century power, they only comprehend hard power. They were basically strafing civilians in Syria with no repercussions, no UN security council resolutions stopped them.
Thriving liberal democracy thing is Western conceit, don't buy it.
Ukrainians never loved Russians since Stalin's forced collectivization campaigns led to mass starvation of Ukrainians.