First, the two examples you list here are not equivalent. In the first example some portion of money circulating in economy is destroyed by the computer virus so reverting it would just keep amount of money in economy constant whereas in the second case you actually expand money supply because people 'loosing money' due to paying rent etc does not mean money in economy is being destroyed. For example, if an economy would have $\$100$ and the computer virus would eliminate $50\%$ leaving the economy with $\$50$, printing additional $\$50$ would just bring the money supply in economy back to $\$100$. However, when people 'loose' money because they are paying rent, buying food and so on money is not being destroyed but just transferred from person A to person B. If I have $\$100$ and pay $\$50$ rent money supply is still $\$100$, printing additional $\$50$ would increase it further to $\$150$.
The above being said it actually makes sense to expand money supply during recessions but it is not consequence free. Money in itself is not source of wealth - production of goods and services is where wealth comes from and money is just a measuring stick for its value. If you expand the amount of money in economy and the expansion is believed to be permanent then it will eventually lead higher prices since more money will be chasing the same amount of goods and services leading to inflation. Society cannot make itself richer just by printing money.
However, inflation is actually what you want during recession because there are many market rigidities such as sticky wages which can make recession worse than they are. In recession you want wages to fall to prevent unnecessary high unemployment, but people often have long term contracts with stipulated nominal wages that would take time to renegotiate. Inflation helps to 'grease the wheels of economy' because by reducing the value of money it reduces the value of peoples' wages in real terms.
Furthermore, in recession many business might face a liquidity problems - they might be overall healthy and profitable but might have hard time to have enough cash at hand. In that kind of situation you would again want to expand money supply in order to make more cash avaiable for them so they do not need to fail unnecessarily.
For these and other reasons central banks around the world are actually expanding money supply now, although they dont do it in a direct way as you described, but rather indirectly through slashing interest rates and buying bonds (see for example how Fed responds to covid19 here). The reason why they do it in this indirect way is that many experts think that if central banks would be just sending money directly to people it would politicize them, but central banks work best when they are independent technocratic institutions. Moreover, some central banks around the world are not even allowed to just do that due to the rules under which they are set up. However, central banks still can do that indirectly by buying government bonds and letting politicians decide on how to organize transfers.
The above being said while monetary expansion during recession helps the economy, the monetary expansion itself does not make economy any richer. This is especially so in situation where the problem is that economy is actually not allowed to produce goods and services in many sectors due to lockdown. Monetary expansion does not solve that underlying problem in any way. If government would just continue sending cash transfers to households payed by expansion of money supply eventually you would just get an inflation and prices would just rise higher and higher. This would have several downsides of eroding peoples savings, at higher levels inflation could also increase uncertainty, it would create menu costs as business would be forced to change their prices too often, shoe leather costs as people would hold less then optimal cash balances, it would create fiscal drag by pushing people into higher tax brackets, it would redistribute income from lenders to borrowers and so on. So it cannot be done just without any cost.