"Thermal energy" is a bit of a misnomer because "thermal" really refers to a method of energy transfer, not energy storage. When energy moves from one system to another, it can do so via a thermal process (e.g. conduction, convection, radiation) or a mechanical process (something pushes on something else). So technically, I wouldn't call $\frac{3}{2}kT$ the thermal energy, but rather the internal energy per particle.
Nevertheless, $\frac{3}{2}kT$ is equal to the average kinetic energy per particle, for an ideal gas whose particles have no relevant dynamics other than translation. (I.e. they can only move, but not rotate, vibrate, change shape, or interact.) You can prove it by first calculating the entropy of an ideal gas, as shown in the Wikipedia article on the Gibbs paradox. In the derivation, the internal energy $U$ is taken to be equal to the kinetic energy. The entropy depends on $U$ in the form $S = kN\ln U^{3/2} + \cdots$, so you can then take the derivative and set it equal to $1/T$:
$$\frac{1}{T} = \frac{\partial S}{\partial U} = \frac{3}{2}\frac{kN}{U}$$
This is easily rearranged to $U = \frac{3}{2}NkT$, and the energy per particle is $U/N = \frac{3}{2}kT$ as expected.