Why are the mass ratios of O to KClO3 and O2 to KClO3 the same?
Your calculations are correct. The key is that you are measuring percentage by mass: the mass of oxygen in 2.062 g of $\mathrm{K}\mathrm{Cl}\mathrm{O}_3$ is the same whether it is considered the mass of individual oxygen atoms or of $\mathrm{O}_2$ (or of any other allotrope of oxygen, for that matter). You have half as many moles of $\mathrm{O}_2$, but the mass is the same (since the mass of 1 mol $\mathrm{O}_2$ is twice the mass of 1 mol O).