Think of the two touching spheres as sitting side by side. The point of contact is the single point where their surfaces meet, and the tangent line drawn there is perpendicular to the line joining the two centres.
For any solid sphere the perpendicular distance from its centre to a tangent of its own surface is exactly the radius $r$. So this tangent is a distance $r$ from each centre.
Moment of inertia of a solid sphere about a diameter is $\dfrac{2}{5}mr^2$. Shifting the axis out to a tangent a distance $r$ away, by the parallel axis theorem, gives for one sphere\[I_{\text{tangent}} = \frac{2}{5}mr^2 + mr^2 = \frac{7}{5}mr^2.\]There are two identical spheres, each the same distance $r$ from the same tangent line, so we simply double it:\[I = 2\times\frac{7}{5}mr^2 = \frac{14}{5}mr^2.\]\[\boxed{I = \frac{14mr^2}{5}}\]