Exactly which bits of the Soviet Union went into which 'Republic' was at the time not terribly relevant; the Empire was not a genuine federal entity and it was never supposed to break up.
Yes, so why wasn't this part of Lithuania, since it's not continuous with the rest of Russia?
Probably because Stalin felt that "Russia" had to get something for its people's role in the "Great Patriotic War" (he was a Russianized Georgian himself, and reversed some earlier Soviet policies that promoted the languages of other constituent peoples), and the part of East Prussia going to the USSR that hadn't been part of Lithuania was probably the only Soviet gain that another constituent republic didn't have a "claim".
The establishment of the Moldavian SSR including modern Transnistria and Ukraine getting Soviet Bukovina and southern Bessarabia happened before the Axis invasion of the USSR, as had the expansions of the Byelorussian and Ukrainian SSRs into inter-war Poland, although there was also an ethnic basis for those areas joining those "republics". Even before the Moldavian SSR was created in 1940 when the Soviet Union annexed territory from Romania, there had been a Moldavian Autonomous SSR within the Ukrainian SSR which included all the then-Soviet territory now in Moldova (I won't say all of modern Transnistria because the Transnistrian and Moldovan governments now each control some small bits of territory on the other side of the pre-1940 Soviet-Romanian boundary) and territory further east that remained in the Ukrainian SSR (no longer "autonomous") and is thus now part of Ukraine.