Such an ordering arises from the fact that they are arranged chronologically, i.e., according to the dates they were "discovered".
The principle quantum number $n$ entered the picture with Bohr's theory of the Hydrogen atom in 1913.Bohr introduced $n$ in his quantization of angular momentum postulate where $n$ is the allowed orbit. Mathematically,
$L = n{h \over 2\pi} = n\hbar$ where $n=1,2,3..$ was called the principle quantum number.
To answer why he settled on the letter $n$, one can only speculate and comment that earlier Planck had used $n$ to denote quantization of energy for light ($E=n\hbar\nu $) and hence $n$ was selected to drawn an analogy.
The azimuthal quantum number $l$ was introduced by Sommerfeld in his relativistic atom model (with elliptical orbits) in 1916. The derivation involved finding the solution to Legendre's differential equation.See this for more information.
The magnetic quantum $m_l$ number came into the picture with the Vector Atom model which was based on the concept of space quantization.The Vector Model of the Atom was an extension of the Rutherford-Bohr-Sommerfeld Model. Classically, the orbits of the atomic electrons can orient in all possible directions in space but quantum theory allows certain discrete orientations in space out of all the infinite possibilities and $m_l$ was introduced in this context. (I can not find an exact date and it was due to several physicists, notably Bohr, Somerfeld, Uhlenbeck, Goudsmith, Pauli, Stern and Gerlach.)
Finally the spin quantum numbers $s$ were introduced to strengthen the Vector Atom Model and explain a host of physical phenomena like the Zeeman Effect and also the fact that investigation of alkali spectra using a high resolving power spectroscope revealed that many spectral lines consist of a group of lines very close to each other.Actually to explain this multiple structure of the spectral lines, G.E. Uhlenbeck and S.A Goudsmit put forward the 'spinning electron hypothesis' in 1925 which introduced $s$.
Note that the magnetic spin quantum number $m_s$ is actually a secondary quantum number and is related to spin quantum number $s$ by
$s_z = m_s \, \hbar$ where $m_s = \sqrt{s \, (s+1)} \, \hbar$.
However it is easier to write
$\Vert \mathbf{s} \Vert = \sqrt{s \, (s+1)} \, \hbar $. The symbols have their usual meanings but you may see this more details.
To sum up :
- The principle quantum number got $n$ because it was introduced in the context of quantization of angular momentum and $n$ was used already used to denote the quantization of energy in light.
- The azimuthal quantum number got $l$ because the constant in Legendre's equation is written using $l$ by convention. See this for more details.
- Magnetic quantum number $m$ gets it from the word "magnetic".
- The spin quantum number $s$ gets its name from the word "spin".
Also, the fact that each quantum number depends on the previous one justifies its ordering.