Why weren't the moles of oxygen calculated the same way as C?
You have done combustion analysis, so you have introduced a large amount of oxygen to the ascorbic acid sample.  Because of this, you can't know how much of the oxygen in the $\ce{CO2}$ and $\ce{H2O}$ you produced actually came from the acid sample and how much came from the atmosphere.

But you do know that the mass of your ascorbic acid is the mass of all the carbon plus the mass of all the hydrogen, which you calculated, plus the mass of oxygen.  The difference in mass between what you have calculated and what you started with is the mass of oxygen that was in the ascorbic acid.

If there were any other elements in your sample, such as sulphur or nitrogen, those amounts would also have to be calculated before finally working out how much mass you haven't accounted for which must have been oxygen.