Both have a carbonyl group. Since the carbonyl group of ketone is between alkyl groups it would be difficult for it to form hydrogen bonds compared to aldehydes.Then, aldehydes should have a higher boiling point compared to ketones. Why is it the other way?
It isn't that good a generalization: always look at the data first.
Here is a table of most of the aldehydes and ketones with 6 or fewer carbons (the labels are used in the chart later):
Now plot this on a chart:
Branches is the number of branches in the carbon chain.
Note that while for 3 and 4 carbons the ketones do have higher boiling points, it is not clear this is true for 5 carbon compounds and certainly not true for 6-carbon ones.
So, I'd argue the pattern of boiling points is complicated and there is no simple pattern that needs to be explained.
For ketones and aldehydes of similar molecular mass, ketones have higher boiling point due to the fact that its carbonyl group is more polarized than in aldehydes. So, interactions between molecules of ketones is stronger than between molecules of aldehydes, and that gives a higher boiling point.
Amongst aldehydes and ketones , ketones have higher boiling point ....this is due to the presence of two electron donating alkyl groups around the C=O group which makes them more polar
for ex- boiling point of CH3-CHO = 322 K and dipole moment is 2.52 D
boiling point of CH3-CO-CH3 = 329 K and dipole moment is 2.88D
dipole moment of CH3-CO-CH3 is more than CH3-CHO ...this because there are two electron donating CH3 groups around C=O bond where as there is only 1 CH3 group around C=O in CH3CHO
as dipole moment is more so more polar and hence higher boiling point