Let's say I make drinking water illegal, would you still do it? Sure you would, you need it to live, laws be damned.
In Argentina it was a similar situation, financially speaking, but with USD, as Argentina had like 1000% accumulated inflation since 2019, so basically the ARS melted in your hands, and the USD/Euros/crypto where your only safe havens.
So yes, the government made the transactions illegal, but the alternative was becoming poor (we ended up the previous government with around 55% poverty).