The reason affirmative action was struck down is because the are certain federally protected classes of people protected from discrimination -- race, religion, sex, etc. And affirmative action is discriminatory along the race dimension.
But a private university is allowed to discriminate along anything else they want as long as it's a not a protected class. They can discriminate on grades (as they do), SAT score, essays, extracurriculars, athletics, geography, and yes -- legacy.
It's true that legacies are usually whiter relative to the general population, but a lot of factors skew towards racial proportions that are different from the general population (e.g. good grades skew Asian). But as long as the purpose of the discrimination doesn't have racial intent (or intent along another protected class), then no law is being broken. And if the intent of legacies is raising money, then there's no winnable case here. Alas.