Is this legal outside of the US? I remember there was a case in China in which a restaurant would charge a different price for tourists.
That means we don't actually need to make it illegal; since, as the blog post linked in the grandparent notes, "it pisses the heck off of people," the free market will take care of it for us if we're patient.
That blog post mentions specific multiple instances of companies that attempt egregious segmentation getting their lunch eaten by companies that don't.
As I said, the whole article is worth reading.
Sadly, procurement departments at big corporations play the big discount game (their bonuses are tied to the discount they get): don't get surprised if they try to diqualify you if you don't give a discount.