That's a good and interesting point. I guess I have less moral problem with it if the item in question is a final product (such as work of art) than a tool, and if the price difference is not large (say up to half of order of magnitude).
But I actually think student discounts are wrong for moral reasons, because they discriminate against non-students, but I do find discounts for young people and older people (in most cases) acceptable.