Why does a real gas with attractive forces between particles experience an increase in internal energy when expanding isothermally?
The internal energy change with temperature can be found from one of the Maxwell equations and is 

$$ \left (\frac{\partial U}{\partial V}   \right)_T = T\left (\frac{\partial p}{\partial T}   \right)_V -p$$

and  a real gas can be represented  with the empirical van-der-Waals equation $\displaystyle (p+a/V^2)(V-b)+RT$ where a represents the attractive potential and b the molecular volume. 

Performing the calculation gives 

$$ \left (\frac{\partial U}{\partial V}   \right)_T = \frac{a}{V^2}$$

which shows what you note in your question. 

As the gas expands work has to be done to separate the molecules because they have an attractive  potential between them, thus the internal energy has to increase  because the temperature is held constant. If the gas was thermally isolated during expansion it would cool and this is observed in the Joule-Thomson effect.