2. Given sets:
$$
\begin{array}{l}
A=\left\{(x, y) \mid x+a^{2} y+6=0\right\}, \\
B=\{(x, y) \mid(a-2) x+3 a y+2 a=0\} .
\end{array}
$$

If $A \cap B=\varnothing$, then the value of $a$ is ( ).
(A) 3 or -1
(B) 0
(C) -1
(D) 0 or -1
2. D.

From the problem, we know
$$
x+a^{2} y+6=0 \text { and }(a-2) x+3 a y+2 a=0
$$

are both equations of lines.
If $A \cap B=\varnothing$, then these two lines have the same slope and do not coincide.
From the same slope, we get $a^{2}=\frac{3 a}{a-2}$.
Thus, $a^{3}-2 a^{2}-3 a=0$.
(1) When $a=0$, it is verified to be true.
(2) When $a \neq 0$, from equation (1) we get
$$
a^{2}-2 a-3=0 \Rightarrow a=-1,3 \text {. }
$$

Upon verification, $a=-1$ satisfies the condition;
When $a=3$, the two lines coincide, so it is discarded.
In summary, $a=0$ or -1.