Is being valedictorian important?

At our local public, a bunch of kids “only” in the 10% got into much better schools than the val did. In this case, I think the reason is that the ranking procedure at our HS gives relatively little weight to AP classes, and the val had a weaker schedule, but higher weighted average. Clearly the admissions offices could see this.