Legal discrimination is simply treating a protected class different than other on the face of the situation. The "mindset" of the person is mostly or entirely irrelevant. While in the past, mindset and "legal" discrimination came hand-in-hand, that is not the case these days.
As this is official policy, this could indeed open a can of worms. An argument per quod is that poor dental hygiene is to lack of access to dental care due to being low income and not getting employment benefits from a previous job. Or due to low income, the individual is stuck eating cheaper grains because healthier foods are simply more expensive.
I also get why the policy is there...a customer seeing someone with shitty teeth will naturally be repelled and then project the negative reaction to everything else in the store; they may not return or leave negative reviews complaining about hygiene and sanitation.