Why will two bubbles floating on water surface attract each other?

Vella and Mahadevan explain the effect as follows:

For simplicity, we consider the latter case schematically illustrated in Fig. 2, although the explanation of the clustering of many bubbles is similar. Here, the air–water interface is significantly distorted by the presence of the wall the well-known meniscus effect, and because the bubble is buoyant, there is a net upward force due to gravity, Fg , on the bubble. Because it is constrained to lie at the interface, however, the bubble cannot simply rise vertically, and instead does the next best thing by moving upward along the meniscus. [..........] A single bubble will deform the interface just as the presence of a wall does, although for a different reason and to a lesser extent. In the case of the bubble, it can only remain at the interface because the buoyancy force, which tends to push the bubble out of the liquid, is counterbalanced by the surface tension force, which opposes the deformation of the interface and hence acts to keep the bubble in the liquid. These two competing effects reach a compromise where the bubble is partially out of the liquid but the interface is slightly deformed. This deformation is sufficiently significant to influence other bubbles nearby, which move upward along the meniscus and so spontaneously aggregate.

Figure 2 obtained from Vella and Mahadevan

They also provide an answer for the force of interaction between two particles with a Radius $R$: $$F(l)=-2 \pi R B^{5/2}\Sigma^2 K_1\left(\frac{l}{L_c}\right)$$

With Bond number $B= \frac{R^2}{L^2_c}$, $L_c=\sqrt{\gamma/\rho g}$, $\Sigma$ a dimensionless Archimedes weight parameter and $K_1$ a first order Bessel function.

For more information, consult the paper.