It may be that federal law will be called into play to overturn the law, but I don't know if there is a federal law addressing the issue. But, when you look at your money, it clearly says "
This note is legal tender for all debts, public and private." I think it could be successfully challenged in court.
I remember years ago (about 1976, as I recall), my car was in for repairs and I needed to rent a car for a couple of days. None of the rental agencies would let me rent one with cash (back then I had no credit card or even a checking account). Finally the Ford dealership rented me one, but I had to put an extra $100 deposit on it before they would do it. I remember being shocked that no one would take my cash, and thinking that someone with time and money could have challenged it in court--but I wasn't that person.