Why do sports have weight classes but not height classes?
Because weight confers a direct, mechanical advantage in the specific sports that use classes, and it is the only body attribute that is both decisive and adjustable — while height, though frequently advantageous, is neither.
Where weight classes exist: combat sports — boxing, wrestling, judo, mixed martial arts, taekwondo — and weightlifting, powerlifting and rowing.
Why weight specifically. In a combat sport, mass translates directly into the force that can be delivered and absorbed. A substantially heavier opponent has an advantage that skill frequently cannot overcome, and — importantly — the mismatch is dangerous, not merely unfair. Weight classes exist partly as a safety measure, which is the argument that settles it.
In weightlifting, absolute strength scales with body mass, so comparing lifters of very different sizes measures size as much as strength.
Why not height classes:
Height is not adjustable, so a class system would permanently exclude people rather than group them. Weight can be managed, which means athletes can compete in a class that suits them.
Height's advantage is sport-specific and not universal. Height helps enormously in basketball and volleyball; it is a disadvantage in gymnastics, diving, weightlifting and coxing. There is no single direction of benefit to correct for.
It is rarely a safety issue, unlike a large weight disparity in a contact sport.
Sports select for body types, and that is accepted. Elite sport is not designed to be equally accessible to all physiologies — being unusually tall or short is an advantage in some events and a barrier in others, and the same applies to limb proportion, muscle fibre composition and lung capacity.
The uncomfortable consequence of weight classes: weight cutting. Athletes dehydrate severely to make a lower class then rehydrate before competing, which is dangerous, has caused deaths, and undermines the fairness the classes were meant to provide. Same-day weigh-ins, hydration testing and reduced gaps between weigh-in and competition are among the responses.
Youth sport sometimes does group by size or maturity — bio-banding — precisely because development varies.