One of his classmates in the class of 1936, Benjamin O. Davis Jr, was the first African-American to attend West Point in nearly 50 years, and would go on to lead the Tuskegee Airmen into battle. Davis suffered from a set of social isolation during his entire four years at USMA, never had a roommate, no one talked to him during meals, no one talked to him outside of class, he was not invited to dances or social events, etc. trying to drive him out of the Academy and return it to the all-White way it had been. Apparently Westmoreland wasn't one of the ring-leaders of this ostracism, but as First Captain it sure as hell was his job to stop it, and he failed to do so.
This started a pattern for Westmoreland, of being wrong about things but getting promoted anyway, that continued for the rest of his life. _Westmoreland: The General Who Lost Vietnam_ by US Army in Vietnam veteran Lewis Sorely, is appropriately scathing of the man and his failures.
The obvious answer is pretty simple: graduation order determined time-in-rank seniority, so they were considered for promotion before anyone else, and this both continues and compounds throughout their career.
Is there an actual correlation to military performance? Probably, and probably slightly more so for the academy than other schools, because of the way that subjects are taught. I later went to several other name-recognizable universities, and there are large differences in the pace and depth of what is taught and tested, with the academy having a much greater pace over much more material at a much lighter depth, so it’s kind of like testing your ability to take in a lot of information very quickly and react to it, rather than master a domain of knowledge and creatively expand upon it.
There is also a social effect of named leaders to gain support among a cohort, especially in ‘minority’ populations, which are formed by commissioning source in the military officer corps. For example, Westmoreland was “first rat” at The Citadel, which has a much lower admission standard than West Point, but it was a brutal program with fierce advocacy among graduates.