Its interesting to speculate about why humans (and certain other animals) lost the ability to produce vitamin C.
I read some interesting answers on Quora:
Why don’t humans synthesize vitamin C? What is the evolutionary advantage?
I’m gonna play the devil’s advocate here and say that there might have been a reason why this gene was turned into a pseudo-gene.
The answer: the pseudo-genomorphosis (yes, I just made that up; so what, sue me) of the urate oxidase gene.
Urate oxidase is a gene that allows uric acid to be converted into 5-Hydroxyisourate, which is then transformed into allantoin and excreted through the renal system. And because all higher primates, including humans, lack a functional copy of this gene, we have an elevated (actually, close to saturation) rate of uric acid compared to every other uric acid-producing organism on Earth (hell, even bacteria have this gene).
And as it turns out, uric acid is a potent antioxidant, just like ascorbic acid (vitamin C), but unlike ascorbic acid, it doesn’t require energy to be made (since it’s a waste product). This may have been why apes live longer (less oxidative stress) than other animals with similar weight.
However, ascorbic acid isn’t only used as an antioxidant, which is why we still need some amount in our diets. However, in response to that we also developed an ascorbic acid recycling system in our red blood cells, that can re-reduce oxidized ascorbic acid back into its original form. This means that our daily intake of vitamin C only has to be around 20 mg minimum (optimally 70–100 mg), while other species of similar weight produce more than 10,000 mg a day.
Good this is, this molecule is nearly ubiquitous in nature: most plants and animals produce their own vitamin C, and since we do consume most plants and animals, albeit raw; ascorbic acid is denatured by heat and light. This isn't a problem for most plants; but for animals… that would mean raw liver is on the menu.
Here is another Quora answer:
The loss of the ability to synthesize Vitamin C in humans is due to a mutation in the gene encoding the enzyme L-gulonolactone oxidase, which is necessary for Vitamin C synthesis. This mutation occurred approximately 40-25 million years ago in our primate ancestors. The evolutionary advantage of this loss is not entirely clear, but some hypotheses suggest that it may be related to dietary changes and the availability of Vitamin C-rich foods in the environment at the time. It's also been proposed that the loss of Vitamin C synthesis may have been a trade-off for other evolutionary advantages, such as energy conservation or protection against oxidative stress. However, the exact reason for this loss and its evolutionary advantage is still a topic of scientific debate.
Evidence suggests that humans are meant to eat a certain amount of fruit in their diet (I'm looking at the carnivore diet guys). Sure you can get by on 20mg of vitamin C (or perhaps less if you are on carnivore diet) but its suboptimal for your health.