I am just writing my comments as an answer. The main computations have to do with the cotangent complex of a stable map. I will work with unpointed stable maps for simplicity (the associated cotangent complex is a bit more complicated in the pointed case).
Notation and Hypotheses. Let $k$ be an algebraically closed field. Let $C$ be a geometrically reduced, at-worst-nodal, proper $k$-curve $C$ (or even just a curve with local complete intersection singularities). Let $$u:C\to X$$ be a $k$-morphism.
Definition. For every irreducible component $C_i$ of $C,$ denote by $\{p_{i,j}\}_j$ the finite set of intersection points of $C_i$ with the union of the remaining irreducible components of $C_i.$ The component is contracted if the restriction of $u$ is constant. The component is inseparable if the restriction of $u$ is non-constant, yet the induced $k$-morphism, $C_i\to u(C_i),$ is inseparable. A component is non-hyperbolic if either the arithmetic genus of $C_i$ equals $1$ and $\{p_{i,j}\}$ is an empty set (i.e., $C$ equals $C_i$) or the arithmetic genus equals $0$ and the $k$-scheme $\{p_{i,j}\}$ has length $\leq 2.$ A component is unstable if it is contracted and non-hyperbolic, otherwise it is stable. A component is non-DM if it is inseparable and non-hyperbolic, otherwise it is DM. If every component of $C$ is stable, then $(C,u)$ is a stable map. If every component of $C$ is stable and DM, then $(C,U)$ is a DM stable map.
Proposition. Let $S$ be an excellent, Noetherian scheme. Let $X\to S$ be a locally finitely presented morphism. There is an algebraic $S$-stack, $\mathfrak{M}(X),$ whose objects over every $S$-scheme $T$ are pairs $$(\pi:C\to T,u:C\to X\times_S T)$$ of a proper, fppf morphism $\pi$ of relative dimension $1$ and a $T$-morphism $u$ and whose isomorphisms of objects, $$\phi: (\pi:C\to T,u:C\to X\times_S T) \to (\pi':C'\to T,u':C'\to X\times_S T),$$ are $T$-isomorphism $\phi:C\to C'$ such that $u'\circ \phi$ equals $u.$ There is an open substack $\overline{\mathcal{M}}(X)\subset \mathfrak{M}(X)$ parameterizing precisely those families where every geometric fiber $C_k$ is a connected, reduced, at-worst-nodal curve and $(C_k,u_k)$ is a stable map. The diagonal $\Delta:\overline{\mathcal{M}}(X) \to \overline{\mathcal{M}}(X) \times_S \overline{\mathcal{M}}(X)$ is finite. Finally, there is an open substack $\overline{\mathcal{M}}^{\text{DM}}(X)$ of $\overline{\mathcal{M}}(X)$ parameterizing precisely those families where every geometric fiber $(C_k,u_k)$ is a DM stable map. This is the maximal open substack of $\overline{\mathcal{M}}(X)$ that is a Deligne-Mumford stack.
Proof. The first result follows by Proposition 3.6 of the following.
MR2854858
de Jong, A. J.; He, Xuhua; Starr, Jason Michael
Families of rationally simply connected varieties over surfaces and torsors for semisimple groups.
Publ. Math. Inst. Hautes Études Sci. No. 114 (2011), 1–85.
The assertion about $\overline{\mathcal{M}}(X)$ is implicit in the original article of Kontsevich.
MR1363062 (97d:14077)
Kontsevich, Maxim
Enumeration of rational curves via torus actions. The moduli space of curves (Texel Island, 1994), 335–368,
Progr. Math., 129, Birkhäuser Boston, Boston, MA, 1995.
For the final assertion regarding $\overline{\mathcal{M}}^{\text{DM}}(X),$ it is useful to use the cotangent complex. The cotangent complex of $u,$ $L_u,$ is a complex of $\mathcal{O}_C$-modules (already for the Zariski topology) concentrated in degrees $(-\infty,0]$ whose cohomology sheaves are coherent, and whose degree $0$ cohomology sheaf $h^0(L_u)$ is naturally isomorphic to the cokernel of the following homomorphism of $\mathcal{O}_C$-modules, $$u^*\Omega_{X/k}\xrightarrow{(du)^\dagger} \Omega_{C/k}.$$
The Zariski tangent space of the automorphism group scheme of $\mathfrak{M}(X)$ at $[(C,u)]$, i.e., the Zariski tangent space of the fiber of $$\Delta:\mathfrak{M}(X_k)\to \mathfrak{M}(X_k)\times_{\text{Spec}\ k} \mathfrak{M}(X_k),$$ equals the hypercohomology group $$R^0\text{Hom}_{\mathcal{O}_C}(L_u,\mathcal{O}_C[0]).$$ Similarly, the space of first order deformations (in the sense of Rim-Schlessinger) is
$$R^1\text{Hom}_{\mathcal{O}_C}(L_u,\mathcal{O}_C[0]).$$ Finally, an obstruction space is given by $$R^2\text{Hom}_{\mathcal{O}_C}(L_u,\mathcal{O}_C[0]).$$ (I learned from Ragnar-Olaf Buchweitz not to call this group the obstruction group, because there are always many possible obstruction groups, and the one above might not equal the minimal obstruction group.)
Using one of the two $E_2$-stage spectral sequences of hypercohomology, namely the one computing hypercohomology from the Ext groups of the cohomology sheaves of $L_u$, we can write down some exact sequences relating the hypercohomology groups above to other natural cohomology groups. This is, roughly, the analysis in Fulton-Pandharipande where they prove that the stack of stable maps from genus $0$ curves to $\mathbb{P}^n$ is smooth in characteristic $0$.
Even without spectral sequences (and in any characteristic), we have, $$R^0\text{Hom}_{\mathcal{O}_C}(L_u,\mathcal{O}_C[0]) = \text{Hom}_{\mathcal{O}_C}(\text{Coker}(du)^\dagger,\mathcal{O}_C) \subset \text{Hom}_{\mathcal{O}_C}(\Omega_{C/k},\mathcal{O}_C).$$
Since $C$ is geometrically reduced, the summand of $\text{Coker}(du)^\dagger$ coming from the zero-dimensional components of this sheaf has only the zero homomorphism to $\mathcal{O}_C.$ Thus, the trouble comes from irreducible components of $C$ that are contained in the support of this sheaf.
Now assume that $(C,u)$ is a stable map. For every irreducible component $C_i$ of $C,$ the restriction to $C_i$ of the $\mathcal{O}_C$-module $\Theta_C=\textit{Hom}_{\mathcal{O}_C}(\Omega_{C/k},\mathcal{O}_C)$ is an $\mathcal{O}_{C_i}$-submodule of $$\textit{Hom}_{\mathcal{O}_{C_i}}(\Omega_{C_i/k},\mathcal{O}_{C_i})\left(-\sum_j \underline{p}_{i,j}\right) = \Theta_{C_i/k}\left(-\sum_j \underline{p}_{i,j}\right).$$ For irreducible components $C_i$ of arithmetic genus $\geq 2,$ already $\Theta_{C_i/k}$ has no nonzero sections. If the arithmetic genus is $0$, then $\Theta_{C_i/k}$ has a one-dimensional vector space of sections, but there are no sections that vanish on the $\geq 1$ points $p_{i,j}.$ Finally, if $C_i$ has arithmetic genus $0$, i.e., if $C_i$ is isomorphisc to $\mathbb{P}^1,$ then $\Theta_{C_i/k}$ is $\mathcal{O}_{\mathbb{P}^1}(2)$, but twisting down by the $\geq 3$ points $p_{i,j}$ makes the degree negative. Thus, the hyperbolic components do not contribute to the global sections. In particular, since $u$ is stable, the contracted components of $u$ do not contribute to the Zariski tangent space of the automorphism group scheme. Therefore, the only nonzero contributions must come from non-hyperbolic components of $C$ that are contained in the support of $\text{Coker}(du)^\dagger.$
For every non-contracted component of $C$ that maps separably to its image in $X$, the morphism $(du)^\dagger$ is generically surjective on that component, so the component is not in the support of $\text{Coker}(du)^\dagger.$ Thus, the only contributing components $C_i$ are the non-DM components. For every non-DM component, there will be nonzero global sections of $\Theta_{C_i/k}(-\sum_j \underline{p}_{i,j})$ that give nonzero elements of the Zariski tangent space of the automorphism group scheme. Thus, the Zariski tangent space of the automorphism group scheme is nonzero if and only if there exists a non-DM component. QED
If we specify also an ample invertible sheaf $\mathcal{O}_X(1)$ on $X,$ then the degree on every bad component $C_i$ of $u^*\mathcal{O}_X(1)$ is a positive integer that is divisible by $p.$ Thus, the total degree of $u^*\mathcal{O}_X(1)$ on all of $C$ is at least as positive as $p$. So for a finite type, polarized scheme $(X_R,\mathcal{O}_X(1))$ that is defined over a finitely generated $\mathbb{Z}$-algebra $\textbf{R}$ that is an integral domain with characteristic $0$ fraction field, for every fixed integer $e$, for the $R$-stack of stable maps with the degree of $u^*\mathcal{O}_X(1)$ bounded above by $e$, the stack is a Deligne-Mumford stack after base change to $R[1/e].$ So the non-Deligne-Mumford behavior only happens for "small" primes.