In Moscow we could use Dollars more or less at most places, but deeper into the country it was harder for the Russians to use dollars so the local economy was Ruble only.
If the Ruble continued to fall, and someday the exchange markets reopened, they could buy more Rubles with the dollars they exchanged with us. This is important because while the exchange rate continued to worsen, their income stayed relatively the same. If they made (pulling a number out of thin air) $10,000 a year, or R15m at the start of our trip, they were only making $2,800 a year at the end even though the number of Rubles they made stayed the same.
If the Ruble continued to fall, say to 8,000:$1 they'd end up making less than $1,900 a year. However, if they bought USD from us at 5500:1 it meant that if it fell, they could buy back 8,000 Rubles for each dollar later, keeping them closer to $2,800 exchangeable dollars.
If the Ruble reverted back to the original rate (1500:$1) then they'd lose their shirts because they just gave us their currency at less than 1/3 value.
Just as importantly, if they were making about $10,000/year, exchanging $400 or whatever with an American kid meant that half their monthly salary was locked up in nonexchangeable USD. The USD had value, but it was non-liquid at that moment.
IIR they weren't able to exchange the dollars until later that year and there were caps on the amount that could be exchanged at once. The next year we repeated the exchange program and I believe some of those dollars we exchanged with them were brought with them to use here.
A few years later, in 1998 the Ruble was reformed on a 1,000:1 basis.
Things were devaluing so fast that people still had Kopek coinage sitting in coin jars that were unspendable and stacks of low denomination currency (1 Ruble to 500 Rubles) that while spendable, were incredibly inconvenient.
Despite often being illegal, Soviet Union had a history of people holding a portion of their savings in foreign currency(just look up Bulgakov's Master and Margarita or Ilf and Petrov's Golden Calf for early references).
So if your local currency is in a free fall you would be well advised to convert your local roubles into hard currency.
I rememember very well the day that my father exchanged 10,000 roubles for $1,000 in the late 1980s from an American tourist. The official rate was ~1.3 dollars for 1 rouble (rouble was officially more valuable than dollar!) at the time, but the catch was you could only exchange a few hundred at a time in very special circumstances. (I believe this is how it is in Venezuela right now too, other places with currency controls).
So your hosts were making a nice gesture but also being smart in times of uncertainty because historical precedent was that their roubles would become worthless not come up.