It prohibits them from joining alliances, and in giving up territory, it reduces their strategic depth the next time Russia decides to make a move.
And of course, it also gives Russia itself time to look at this invasion, see what went wrong, rebuild the forces it lost, and try again. Given that Russia is a much larger country, and that Ukraine has been wrecked in many respects, it's a deal that favors Russia long-term.
If I were Z I'd take that chance. He can always break his promise before they break theirs, if he's secure. And the world largely wants him bolstered up now, whereas they want Russia to go sit in a corner.