Although I could be wrong, I think the reason is that the density of any fluid, including water, increases very slightly with depth.
There is a well-known relation between pressure and depth,
$$\Delta p = -\rho g \Delta y$$
which says that at the difference in pressure between any two points in the fluid is proportional to the difference in height between those two points. Now, we usually think of a liquid as being incompressible, so that its volume remains the same at any pressure, but in reality this is not true. Liquids do undergo a very slight decrease in volume as the pressure rises. So since the water pressure at the bottom of the tube is higher, the volume of a given amount of water will be slightly smaller at the bottom of the tube than at the top, and therefore the density at the bottom will be a little higher.
If the density of one of the glass bulbs just happens to fall in the range between the density of water at the top and the density of water at the bottom of the tube, then the bulb will come to equilibrium in the middle, at the point where its own density happens to be equal to that of the surrounding water.
Incidentally, Wikipedia reports that the liquid used in a Galilean thermometer is usually not water, but something else that has a more drastic variation of density with temperature. But the argument I've outlined above applies equally well to any normal liquid.