For the four points $A,B,C,D$ in $S$, suppose that out of all the distances $AB,AC,AD,BC,BD,CD$, we have $|AD|$ to be the largest (from now on I will neglect absolute value signs).
Then clearly we must have by the given relation that $AD=AB+AC$ and symmetrically that $AD=DB+DC$.
Now if we assume that both $AC<BD$ and $AB<CD$ then we obtain a contradiction, since this would imply $AB+AC<BD+CD$, i.e. $AD<AD$, which cannot happen. Hence at least one of them is false, say instead $AB\ge CD$.
So $AB\ge CD\implies AB+AC\ge CD+AC\implies AD\ge CD+AC$. Then the triangle inequality prohibits the points $A,C,D$ from not being collinear, so $A,C,D$ lie on a line and in fact equality must hold i.e. $AB=CD$. But then $AD=BD+DC=BD+AB$ so again the triangle inequality prohibits $A,B,D$ not to be collinear; in fact they lie on a line.
So $A,B,C,D$ lie on a line, we are done.