Kodaira's examples have index $\tau>0$. If $M\to S$ were isotrivial, then it is not hard to see that after pulling back to a finite unramified cover of $S$, the surface becomes a product. But this would force $\tau(M)=0$ [See added note below].
You can look at the book *Compact Complex Surfaces* by Barth, (Hulek), Peters, and Van de Venn for further explanation.

There are examples of what are sometimes called Kodaira surfaces, where nonisotriviallity is essentially immediate. Namely, find a compact curve $S$ in $M_g$ (which exists once $g>2$), and pull back the "universal" curve.

**Added Explanation** The index is the signature of the intersection form. By a theorem of Hirzebruch, it can also be computed as
$$\tau(M)= \frac{1}{3}(c_1^2(M)-2c_2(M))$$
It follows that if $M'\to M$ is a finite unramified cover, then $\tau(M')=0$ if and only if $\tau(M)=0$. In particular, if $M'$ can be chosen as a product of curves, then it can be checked that $\tau(M')=0$, so $\tau(M)=0$.