I think it's reasonable to have some sanitation and pleasentness standards in a restaurant. Anyone from any economic class could meet or not meet those standards. It may be harder for a homeless person to stay relatively well kept, but I don't think that is the responsibility of the restaurants to fix. We should reduce the people living in filth, not accept and encourage filth I'm public spaces.
edit: also, the no-cash policy does not filter against the "middle class home owner who hasn't bathed in months", so that does not hold.
More interesting would be to get a business license you must supply services to different tiers of pricing access.
Instead, this policy clearly screens against a group of PEOPLE (those without access to electronic means of payment), which may or may not overlap with those participating in the undesirable "behaviors" I agree a restaurant should have the right to not tolerate.