The discussion of the Klein-Gordon equation (KGE) assumes a relativistic context. For convenience the KGE reads:
$$(\square - m^2)\phi(x^{\mu})= 0 \tag{1}.$$
From partial differential equation solving (PDES) perspective we can simply apply a Fourier transform (FT) on the scalar field of $(1)$:
$$\phi(x^{\mu}) = \mathcal{N}\int^{+\infty}_{-\infty}\phi(p^{\mu})e^{ip_{\nu}x^{\nu}}d^{4}p \equiv \mathcal{N}\int^{+\infty}_{-\infty}\phi(p^{\mu})e^{ip_{\nu}x^{\nu}}dp^{\mu} \tag{2},$$
where $\mathcal{N}$ is a normalization constant.
Now, $(2)$ is, in my opinion, the most natural way to think about solving $(1)$ using FT method. Because, you have a covariant equation, $(1)$, and a integral with a covariant differential $dp^{\mu} \equiv d^{4}p$, $(2)$. But it seems that, as soon as you want to merge physical intuition with PDES methods, the notations start to become confusing; I will explain.
Let the Klein-Gordon equation be written as:
$$\Big(-\frac{\partial^{2}}{\partial t^{2}} + \nabla^{2} - m^2\Big)\phi(t,\vec{x})= 0 \tag{3}.$$
Then, there are two annoying notations:
$$\phi(t,\vec{x}) = \mathcal{N}\int^{+\infty}_{-\infty}\phi(t,\vec{p})e^{i\vec{p}\cdot \vec{x}}d^{3}p \equiv \mathcal{N}\int^{+\infty}_{-\infty}\phi(t,\vec{p})e^{i\vec{p}\cdot \vec{x}}d\vec{p}, \tag{4}$$
$$\phi(t,\vec{x}) = \mathcal{N}\int^{+\infty}_{-\infty}a_{\vec{p}}(t)e^{i\vec{p}\cdot \vec{x}}d^{3}p. \tag{5}$$
So, I would like to ask:
Since you know you're dealing with a 4-dimension solution, you want to work with covariant expressions. Why in Earth do text books use a 3D FT( $(4), (5)$) and not the (simpler) 4D FT $(2)$ in the first place?
I would like to point out that I know the difference between a 4D formalism and $3+1$-formalism. I mean, the $3+1$-FT is totally different from $(4), (5)$:
$$\phi(x^{\mu}) = \mathcal{N}\int^{+\infty}_{-\infty}\phi(p^{\mu})e^{ip_{\nu}x^{\nu}}d^{4}p = \phi(t,\vec{x}) = \mathcal{NC}\int d\omega \int \phi(t,\vec{p})e^{\mp i(\omega t-\vec{p}\cdot\vec{x})}d^{3}p \neq \mathcal{N}\int^{+\infty}_{-\infty}\phi(t,\vec{p})e^{i\vec{p}\cdot \vec{x}}d^{3}p.$$
Where, $\mathcal{N} = \frac{1}{(2\pi)^{3}}$ and $\mathcal{C} = \frac{1}{2\pi}.$