Is the main purpose of cascoding is to increase gain in FETs?
It is mainly done to increase the output resistance and or reduce the Miller effect.

An example of increasing output resistance is the cascode current mirror.

An example of Miller effect mitigation is a normal cascode amplifier.  Of course this also increases the output resistance, but a driving reason is to mitigate Miller effect.

The gain does not increase (although the bandwidth due to mitigated Miller effect does go up) because the first transistor has no voltage gain (voltage gain of 1) but provides a current gain.  The next transistor provides the voltage gain.  If you do the math it ends up (ignoring parasitics and making approximations) matching the gain of the regular common-emitter or common-source amplifier: \$R_L/R_{ee} \$