The gravitational pull on the empty plastic bottle is less than the upthrust exerted on it by the water. In other words, its density is less than the density of water therefore it floats. On the other hand, a plastic bottle filled with sand sinks as the gravitational pull on it (weight) is more than the upthrust of water.