It is about the spell, shocking grasp. It is IN the spell description. It applies BECAUSE the spell, the magic, this specific instance, an "exception" if you will, says so.
But, on a similar note,
Uncanny Dodge and
Shield are also
exceptions to the general rules of the game, which as you say is core to the assumptions of the exceptions-based design of 5e.
Yes, in most instances, on a hit, the results of the
Shocking Grasp would dictate that the target "takes 1d8 lightning damage, and it can't take reactions until the start of its next turn."
However, both
Uncanny Dodge and
Shield trigger on the
hit event, not the
damage event -- other reactions specifically key off of
damage events. One might argue, "well, that's just to factor in spells and effects that require a save instead of an attack roll," in which case, another can argue that the language about a
damage trigger should have instead indicated a
saving throw failure event, if it's all one event happening simultaneously -- but it's not. A
hit causes
damage and effect (
damage and effect being simultaneous or not).
The reaction triggering on the
hit event is like a filter slipped in the middle of the chain of effect -- in the case of the
Shield spell, it might block the hit, but in the case of the
Uncanny Dodge, it just halves the damage and does not prevent the effect.
The reaction happens between the
hit and
damage and effect events, not after the entire sequence. And especially in this instance, the
Uncanny Dodge is preventing minimal damage, which will keep it fun (considering RAF) for the players, while still preventing subsequent (and potentially more effective) reactions by the target, such as an opportunity attack or a
Counterspell, which is what makes
Shocking Grasp still effective.