Why are magnetic fields only produced by moving charges? Why do charged particles only produce magnetic fields while in motion?
 A: Edit. This answer is not quite right, see my answer in the question duplicate
No magnetic field from a static charge - Is there a simple physical argument to show why?
This is an answer from the perspective of classical electrodynamics.
Basically, the answer is "because Maxwell's equations say so," and these are the fundamental, empirically tested equations of classical electrodynamics.  To be precise we prove the following:
Claim. For any localized charge distribution $\rho$ for which the corresponding current $\mathbf J$ vanishes, the magnetic field is everywhere zero.
Proof. First, recall the continuity equation:
\begin{align}
  \frac{\partial \rho}{\partial t} +\nabla\cdot\mathbf J =   0
\end{align}
The hypothesis $\mathbf J = \mathbf 0$ therefore implies that the charge distribution is static; $\partial\rho/\partial t = 0$.  By Gauss's Law
\begin{align}
  \nabla\cdot \mathbf E = \frac{\rho}{\epsilon_0},
\end{align}
the electric field of a localized charge distribution has the following integral expression:
\begin{align}
  \mathbf E(t,\mathbf x) = \int_{\mathbb R^3}d^3x'\,\rho(t,\mathbf x')\frac{\mathbf x - \mathbf x'}{|\mathbf x - \mathbf x'|}
\end{align}
It follows that since $\rho$ is time-independent, then so is $\mathbf E$:
\begin{align}
  \frac{\partial\mathbf E}{\partial t} = \mathbf 0
\end{align}
That fact, the fact that the current vanishes, and Ampere's Law
\begin{align}
  \nabla\times \mathbf B = \mu_0\mathbf J +\mu_0\epsilon_0 \frac{\partial \mathbf E}{\partial t}
\end{align}
combine to require the magnetic field to have zero curl;
\begin{align}
  \nabla\times\mathbf B = 0
\end{align}
But now recall that one of Maxwell's equations tells us that the divergence of the magnetic field is zero;
\begin{align}
  \nabla\cdot \mathbf B = 0
\end{align}
It follows from the Helmholtz Decomposition, that the magnetic field must vanish everywhere provided it falls off sufficiently rapidly at infinity, a reasonable property that should be true of physical charge distributions.
