As frugivorous apes we got enough vitamin C from our diet that that mutation was a survival advantage. Synthesizing nutrients you can get from your diet is a waste of energy.
Similarly, other species of animals cannot synthesize certain nutrients they get from their diet. Cats, for example, cannot synthesize taurine and must get their required taurine from consuming meat.