Why are numerator coefficients named $b$ and denominator coefficients named $a$? This is not a technical question, it is rather a question about the implicit notation used in MATLAB and some digital signal processing books to refer to the numerator and denominator coefficients of impulse responses or system functions.

When I think of a fraction the first thing that comes into my mind and the first thing I write is the numerator and then the denominator. When I spell the alphabet the first letter is a and the second is b.

When I started reading DSP books and working with Matlab I found:

$$ Y(z)=\frac{b(1)+b(2)z^{-1}+\cdots+b(n_b+1)z^{-n_b}}{1+a(2)z^{-1}+\cdots+a(n_a+1)z^{-n_a}}X(z)$$

and y = filter(b,a,x) respectively

In these cases the first things to write were labeled b (numerator coefficients) and the second things to write were label a (denominator coefficients). This caused me a little bit of confusion at first as it seemed a little bit counter-intuitive. Is there any reason why this was selected in this way?

I'm thinking that maybe poles are considered more important than zeros (due to stability, etc.) so they most be though of first and a comes first in the alphabet... but this is just an educated guess.
My suspicion is that this ordering comes from the difference equation, which in most texts precedes the $\mathcal Z$-transform:

$$a_0 y[n] + a_1 y[n-1] + \cdots = b_0 x[n] + b_1 x[n-1] + \cdots$$