The effect of gravity on a light wave is explained by general relativity, because gravity warps space-time.
Before general relativity, we had the equation F=mg, but of course light waves don't have mass, so this is why relativity was an important shift in the understanding of gravity.
Sound waves are made by the movement of molecules, these molecules have mass. so gravity effects sound waves in 2 ways: 1) F=mg causes the molecules to be pulled towards the source of the gravitational field. 2) the curvature of space-time has a similar effect on sound waves as it does on light waves.
For gravity sources with comparatively low density (such as the earth), the effect of gravity on the curvature of space-time is much smaller than the effect due to F=mg.
So, for sound waves, F=mg is the main effect of gravity on the molecules, but for light waves, the curvature of space-time is the effect of gravity.
Therefore sound and light waves are affected by gravity in different ways.