Relative O-O bond lengths in O2X2 molecules (X = H, F, Cl)
First things first: the shorter a bond, the higher the multiple bond character. I.e. a double bond is shorter than a single bond, and a bond with a bond order of $1.5$ is in the middle of the two. Thus, the shorter the bonds in $\ce{X2O2}$, the higher the corresponding double bond character.

The key to understanding why the bond in $\ce{O2F2}$ has a very high double bond character is the gauche effect. The effect has its name because of the observation that $\ce{O2F2}$ prefers a gauche configuration rather than the expected (due to sterics) anti configuration. The reason is electronic in nature: a lone pair of oxygen A can interact with the $\sigma^*(\ce{O_B-F})$ orbital. This lowers the energy of the populated orbital at the expense of the unpopulated one. Since we have an interaction along $\ce{O_A-O_B}$, this increases the double bond character of the $\ce{O-O}$ bond. At the same time, since we are using the $\sigma^*$ for stabilisation, the $\ce{O-F}$ bond decreases in bond order — it becomes less than a single bond. In Lewis resonance depictions, this can be explained by the following mesomeric structures:

$$\ce{F-O-O-F &lt;-&gt; F-O^+=O\bond{...}F-}$$

This effect is strongest in $\ce{O2F2}$ since fluorine is more electronegative than oxygen and therefore the $\sigma^*$ orbital has a much higher oxygen contribution.

In hydrogen peroxide, a similar mechanism is at play that also contributes to reducing the bond length and increasing the bond order. In $\ce{Cl2O2}$, the effect is weakest.