The Lagrangian density for the real Klein-Gordon field, which describes a real scalar field $\phi$ with mass $m$ is given by
\begin{equation} \mathcal{L} = \frac{1}{2} \partial^\mu \phi \, \partial_\mu \phi - \frac{1}{2} m^2 \phi^2 \end{equation}
This is directly introduced by using the action is invariant under Lorentz transformation in ad hoc manner in few books and then they show it satisfies the Euler-Lagrange equation
\begin{equation} \frac{\partial \mathcal{L}}{\partial \phi} - \partial_\mu \left( \frac{\partial \mathcal{L}}{\partial (\partial_\mu \phi)} \right) = 0 \end{equation}
But what is the importance of $\frac{1}{2}$ here and why $m^2$, why not $m$ ?
The Hamiltonian density of this field,
\begin{equation} \mathcal{H} = \frac{1}{2} \pi^2 + \frac{1}{2} (\nabla \phi)^2 + \frac{1}{2} m^2 \phi^2 \end{equation}
which also satisfies Hamiltonian equations of motions $\dot{\phi} = \frac{\delta \mathcal{H}}{\delta \pi}$ and $\dot{\pi} = -\frac{\delta \mathcal{H}}{\delta \phi}$, if we don't take $\frac{1}{2}$.
Give a physical importance of $\frac{1}{2}$ and $m^2$ instead of $m$. Give the mathematical intution also.
The related questions are physics.stackexchange.com/q/314426/2451 , physics.stackexchange.com/q/732564/2451