For bosonic string theory, see this MathOverflow thread. The arguments are similiar for superstrings, at least in the RNS formalism that I'll be using in this answer.
For superstrings in the Ramond sector:
\begin{array}{l}0 = {{\hat G}_0}\left| \psi \right\rangle \\{\rm{ }} = \sum\limits_{n = - \infty }^\infty {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n}} \left| \psi \right\rangle {\rm{ }}\\{\rm{ }} = \left( {{{\hat \alpha }_0}\cdot\,{{\hat d}_0} + \sum\limits_{n = 1}^\infty {\left( {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n} + {{\hat d}_{ - n}}\cdot\;\;{{\hat \alpha }_n}} \right)} } \right)\left| \psi \right\rangle {\rm{ }}{\kern 1pt} \,\\{\rm{ }} = \left( {\left( {\frac{1}{2}{\ell _P}{p^\mu }} \right)\,\cdot\,\left( {\frac{1}{{\sqrt 2 }}{\gamma ^\mu }} \right) + \sum\limits_{n = 1}^\infty {\left( {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n} + {{\hat d}_{ - n}}\cdot\;\;{{\hat \alpha }_n}} \right)} } \right)\left| \psi \right\rangle \\{\rm{ }} = \left( {\frac{1}{{2\sqrt 2 }}{\ell _P}{\gamma ^\mu }{p_\mu } + \sum\limits_{n = 1}^\infty {\left( {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n} + {{\hat d}_{ - n}}\cdot\;\;{{\hat \alpha }_n}} \right)} } \right)\left| \psi \right\rangle \left( {} \right)\\{\rm{ }} = \left( {\frac{1}{{2\sqrt 2 }}{\ell _P}{\gamma ^\mu }{p_\mu } + \sum\limits_{n = 1}^\infty {\left( {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n} + {{\hat d}_{ - n}}\cdot\;\;{{\hat \alpha }_n}} \right)} } \right)\left| \psi \right\rangle \\\left( {\frac{1}{{2\sqrt 2 }}{\ell _P}{\gamma ^\mu }{p_\mu } + \sum\limits_{n = 1}^\infty {\left( {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n} + {{\hat d}_{ - n}}\cdot\;\;{{\hat \alpha }_n}} \right)} } \right)\left| \psi \right\rangle = 0\\\left( {{\gamma ^\mu }{p_\mu } + \frac{{2\sqrt 2 }}{{{\ell _P}}}\sum\limits_{n = 1}^\infty {\left( {{{\hat \alpha }_{ - n}}\cdot\;\;{{\hat d}_n} + {{\hat d}_{ - n}}\cdot\;\;{{\hat \alpha }_n}} \right)} } \right)\left| \psi \right\rangle = 0\end{array}
This is the Dirac-Ramond Equation.
$${\hat L_0}\left| \psi \right\rangle = \hat G_0^2\left| \psi \right\rangle $$=
$${\hat L_0}\left| \psi \right\rangle = \hat G_0^2\left| \psi \right\rangle $$
$$a = 0$$
Now, consider some Level 1 Neveu-Schwarz Spurious State Vector $\left| \varphi \right\rangle = {\hat G_{ - 1/2}}\left| \chi \right\rangle $
$$0 = {\hat G_{1/2}}\left| \chi \right\rangle = {\hat G_{3/2}}\left| \chi \right\rangle = \left( {{{\hat L}_0} - a + \frac{1}{2}} \right)\left| \chi \right\rangle $$
So, $a = \frac{1}{2}$ in the Neveu - Schwarz sector.
Now, we consider a Ramond Spurious State Vector $\left| \varphi \right\rangle = {\hat G_0}{\hat G_{ - 1}}\left| \chi \right\rangle $ ; where ${\hat F_1}\left| \chi \right\rangle = \left( {{{\hat L}_0} + 1} \right)\left| \chi \right\rangle = 0$
$$0 = {\hat L_1}\left| \psi \right\rangle = \left( {\frac{{{{\hat G}_1}}}{2} + {{\hat G}_0}{{\hat L}_1}} \right){\hat G_{ - 1}}\left| \chi \right\rangle = \frac{{D - 10}}{4}\left| \chi \right\rangle $$
Thus, $D=10$.