Why does the starting compound not need an -OH group? I thought ozonolysis only produced carbonyls?
The product of ozonolysis depends on how you work up the intermediate ozonide. You are clearly familiar with the reductive workup (with dimethyl sulfide or PPh3) that gives two carbonyl compounds, aldehyde or ketone. But if you work up under oxidative conditions, as is the case here, you get carboxylic acids from mono-substituted double bonds and ketones from di-substituted.