2. Let the quadratic function $f(x)=a x^{2}+a x+1$ have a graph that opens downwards, and satisfy $f(f(1))=f(3)$. Then the value of $2 a$ is ( ).
(A) -3
(B) -5
(C) -7
(D) -9
2.B.

Notice
$$
\begin{array}{l}
f(1)=2 a+1, f(3)=12 a+1, \\
f(f(1))=a(2 a+1)^{2}+a(2 a+1)+1 .
\end{array}
$$

From $f(f(1))=f(3)$, we get
$$
(2 a+1)^{2}+(2 a+1)=12 \text{. }
$$

Therefore, $2 a+1=3$ or -4.
Since $a<0$, hence $2 a=-5$.