There is also a fair bit of "common sense" involved here.  Comparing the territory, population and economic concentration of the USSR proper (pre-1939) to present day Russia, Russia is the closest match for a [continuator/succession][1] state.

Russia is also where a lot of the fighting took place that beat Germany, which was certainly a practical part of what originally "earned" UN Security Council veto rights:  being a WW2 victor.

The other USSR constituent states were all much smaller in all those respects and were more or less supportive of Russia's position.

And that's before one gets into who had practical control over most of the nukes to be given up by the 3 Budapest Memorandums as well as the overall USSR military.

Also, from the USA/NATO point of view they had disarmament treaties they had signed with the USSR and they needed a continuation state to take on their responsibilities.

People in 1991 mostly didn't expect Russia to devolve into what it's become today.  Many  Western Europeans were overjoyed to see their cousins "come in from the cold", ditch Communism and become a normal state.  Not so much those who had had direct experience of Soviet rule, maybe.

Why should they have antagonized Russia by withholding this transfer?  Doesn't seem unreasonable on its own and [already asked here before][2].  What's unreasonable is what Russia changed into under Putin.

What about the "legal background" in the question's title?  How does this answer it?  Well, international law and international relations are fuzzy, they're not like national laws where there are enforcement mechanisms and fines.  Outside of formally codified subjects like those found in international treaties, in many cases, the "law" is what the international community agrees to, what the nations' relative power ratios support and what all the horse trading ends up delivering as "law".


  [1]: https://en.wikipedia.org/wiki/Succession_of_states
  [2]: https://politics.stackexchange.com/questions/31767/how-did-russia-retain-the-unsc-veto-power-of-the-soviet-union