The key to this answer is the strength of the forces of attraction in the different states of matter.
The order of interparticle spaces among the states of matter is:
Gas > Liquid > Solid
The order of interparticle forces of attraction among the states of matter is:
Gas < Liquid < Solid
Since water is liquid, sugar is solid and oxygen is gas, so the increasing order of forces of attraction between their particles is:
Oxygen < Water < Sugar