There are a few reason why the carbonyl oxygen gets protonated -
1) The carbonyl oxygen is sp2 hybridized which is more electronegative than the sp3 oxygen. So, it has more tendency to give electrons since it is more negative.
2) The lone pairs of carbonyl carbon are more available since they are not in conjugation whereas the lone pairs of the other oxygen are not much available since they are in conjugation with carbonyl carbon.
3) When carbonyl oxygen donates its electron the resulting structure is more stabilized (because of conjugation) than the structure formed when the other oxygen atom donates.
So, that's why carbonyl oxygen has far more tendency of donating electrons than the -OH grp.