There are several good answers here, one accepted. Nevertheless I'm surprised not to see the $L^2$ norm described as the infinite dimensional analogue of Euclidean distance.
In the plane, the length of the vector $(x,y)$ - that is, the distance between $(x,y)$ and the origin - is $\sqrt{x^2 + y^2}$. In $n$-space it's the square root of the sum of the squares of the components.
Now think of a function as a vector with infinitely many components (its value at each point in the domain) and replace summation by integration to get the $L^2$ norm of a function.
Finally, tack on the end of last sentence of @levap 's answer:
... the $L^2$ norm has the advantage that it comes from an inner
product and so all the techniques from inner product spaces
(orthogonal projections, etc) can be applied when we use the $L^2$
norm.