The problem is that laws are made by other humans. As history and present events have shown, we are not above using the law as a weapon against others. Having a government limited in scope and in power was a feature too.
Assuming for a moment you're not a legal nihilist, if you feel "banning cash would make illegal immigration harder" is bad, a more logical solution is to make legal immigration easier. If you're OK with all the other consequences of a regulation -- in this case, making it difficult to avoid paying sales/income/social security taxes, making it difficult to purchase illegal drugs or weapons, to fund organizations deemed by the government to be "terrorists", etc etc -- and there's only one or two known consequences of the regulation you're not OK with, it's quite possible in many cases to legislate around the downsides.