Consider the Fourier-transformation on $L^1(\mathbb R)$ given by
$$F^1 \colon L^1(\mathbb R) \to C_0(\mathbb R), \quad f \mapsto \widehat f.$$
The fact that $F^1$ maps into $C_0(\mathbb R)$ is usually called the Lemma of Riemann-Lebesgue. However, it is generally not true that $F^1$ maps into $L^1(\mathbb R)$.
Heuristically, consider a function like
$$g(t) := \begin{cases} t^{-1/2}, \quad &\text{if } t > 1, \\ t \quad &\text{if } 0 \leq t \leq 1 \\ 0, \quad &\text{if } t < 0\end{cases}.$$
Then you clearly have $g \in C_0(\mathbb R)$ but $g \notin L^1(\mathbb R)$ as $g$ decays not fast enough to have a finite $L^1$-norm. In particular,
$$\int_{\mathbb R} \lvert g(t) \rvert \, \mathrm d t \geq \int_1^b t^{-1/2} \, \mathrm dt = \Big[2 \sqrt t \Big]_1^b = 2 (\sqrt b - 1) \longrightarrow \infty$$
as $b \to \infty$. So just having the asymptotics $g(t) \to 0$ for $t \to +\infty, -\infty$ is just not enough for a function to end up in $L^1(\mathbb R)$. Due to that one can show with some more effort that $C_0(\mathbb R) \setminus F^1(L^1(\mathbb R)) \neq \emptyset$. This is not as easy as the argument above but still a standard result. Note that generally $F^1$ is therefore not bijective.
However, if $f \in L^1(\mathbb R)$ is such that $F^1(f) \in L^1(\mathbb R)$, then the Fourier inversion theorem shows that $f(x) = F^1(F^1(f))(-x)$ for all $x \in \mathbb R$. Thus, $F^1$ is only invertible on the so called Fourier–Stieltjes algebra
$$A(\mathbb R) := \{f \in L^1(\mathbb R) : F^1(f) \in L^1(\mathbb R) \}.$$
The situation on $L^2$ is way more elegant: Recall that the set $C_c^\infty(\mathbb R)$ (or alternatively the set of Schwartz functions $\mathcal S(\mathbb R) \supseteq C_c^\infty(\mathbb R)$) is dense (both in $L^1(\mathbb R)$ and $L^2(\mathbb R)$) and that Plancherel's theorem yields that $\lVert F^1(f) \rVert_2 = \lVert f \rVert_2$ for all $f \in \mathcal S(\mathbb R)$.
Thus, by standard operator theory one can extend the map
$$F^2 \colon \mathcal S(\mathbb R) \to L^2(\mathbb R), \quad f \mapsto F^1(f) $$
to an isometric isomorphism, i.e. a bijective operator $F^2 \colon L^2(\mathbb R) \to L^2(\mathbb R)$ such that $\lVert F^2(f) \rVert_2 = \lVert f \rVert_2$ for all $f \in L^2(\mathbb R)$. So on $L^2$ you can Fourier transform functions back and forth without having to worry about it. And this is the main advantage of working on $L^2(\mathbb R)$.
A similiar idea yields that the Fourier transformation $\mathcal F \colon \mathcal S(\mathbb R) \to \mathcal S(\mathbb R)$ is also a linear homeomorphism on the Schwartz space $\mathcal S(\mathbb R)$ equipped with the usual Fréchet space topology. And this is the base for defining the Fourier transformation on the space of tempered distributions $$S(\mathbb R)' := \{u \colon S(\mathbb R) \to \mathbb C : u \text{ is linear and continuous}\}$$
by defining the Fourier transform $\mathcal F u \in S(\mathbb R)'$ of a tempered distribution $u \in S(\mathbb R)'$ via the action
$$\langle \mathcal F u, \varphi \rangle := \langle u, \mathcal F \varphi \rangle \qquad (\varphi \in \mathcal S(\mathbb R)).$$
Analogously, one defines the inverse Fourier transform $\mathcal F u \in S(\mathbb R)'$ of $u \in S(\mathbb R)'$ via
$$\langle \mathcal F^{-1} u, \varphi \rangle := \langle u, \mathcal F^{-1} \varphi \rangle \qquad (\varphi \in \mathcal S(\mathbb R)).$$
Hence, you can also Fourier transform tempered distributions back and forth without having to worry about it which is a very important technique in the PDE's.
Finally, the $L^1$- and $L^2$-theory (above for the case $G = \mathbb R$) generalizes to Fourier transformations on arbitrary locally compact abelian groups $G$ in abstract harmonic analysis. For the distribution theory on the other hand, you need some kind of additional differentiable structure on your group. So naturally one generalizes this part of the theory to Lie-Groups. The Heisenberg group $\mathcal H$ plays, as far as I know, a prominent role when it comes to this topic.