if air had no weight, then all of the mercury in the tube would sploshing out, gravity would make it fall down, but if air had weight, then the weight of the air pushing down on the bath of the mercury would reach some equilibrium with the weight of the mercury in the tube and that mercury will go down only so far.