Note that the derivative is evaluated at $0$ in a limiting sense. That is, the $n$th order moment of $X$ is given by $$E[X^n]=M^{(n)}(t)\Big\lvert_{t=0}=\lim_{t\to 0}M^{(n)}(t)$$