Make a drawing of the sphere and the line $l$ and notice that one of the tangent planes must pass quite close to the origin. It makes sense to check if it might be the plane that goes through the origin exactly. This gives $4x+3z=0$ and it is easy to verify that this plane is at the right distance from the centre of the sphere, so it is a tangent plane. Then, the other tangent plane is obtained from the first by reflecting it in the plane that passes through the line $l$ and the centre of the sphere, which gives $2x-y+2z+3=0$.
So, making a drawing and a guess is the easiest way to solve this problem. Your way of solving it is fine, but there is a more straightforward way, which relies on Plücker coordinates. You want to find two plane that pass through $l$ and are at the right distance from the centre of the sphere. For a plane defined by
$$ax+by+cz+d=0,\quad\textrm{where}\quad a^2+b^2+c^2=1,$$
these two conditions are satisfied if
$$|3a+2b+c+d|=3$$
and
$$\begin{pmatrix}
0&p_{23}&p_{31}&p_{12}\\
-p_{23}&0&p_{03}&-p_{02}\\
-p_{31}&-p_{03}&0&p_{01}\\
-p_{12}&p_{02}&-p_{01}&0
\end{pmatrix}
\begin{pmatrix}d\\a\\b\\c \end{pmatrix}=0,$$
where $(p_{01}, p_{02}, p_{03},p_{23},p_{31},p_{12})$ are the Plücker coordinates of $l$. For your problem, this gives the following equations:
$$3a-2b-4c=0, \\-3d-9b=0, \\2d+9a-12c=0,\\ 4d+12b=0,\\
|3a+2b+c+d|=3,\\
a^2+b^2+c^2=1,$$
which can be solved easily in mathematica.
The short answer is that the very meaning of the tangent plane implies that the slope in every direction agrees with the slope of the tangent plane.
For a longer answer, there are a few things to say.
First, there certainly do exist functions so that the slopes in different directions do not all agree with the slope of any plane; an example in polar coordinates is
$$f(r,\theta) = r \cos(3\theta)
$$
Using the identity
$$\cos(3\theta) = \cos^3(\theta) - 3 \cos(\theta) \sin^2(\theta)
$$
this converts into $x,y$ coordinates as
$$f(x,y) = \frac{x^3 - 3xy^2}{x^2+y^2}
$$
This function extends continuously to $(0,0)$ using $f(0,0)=0$. And it has directional derivatives in every direction. But it has no tangent plane at $(0,0)$, precisely because the slopes in the different directions do not agree with the slopes of any single plane through $(0,0)$. To see why, notice that the slope in the $\theta$ direction is equal to $\cos(3\theta)$, and as $\theta$ rotates around in a circle this slope has three maximum values of $1$, which is not possible for a plane.
Second, one might well wonder what is the meaning of the tangent plane. A good answer to this requires the following standard definition of multivariable calculus:
Definition: To say that $f(x,y)$ is differentiable at a point $(a,b)$ means that there exists a linear function $L : \mathbb R^2 \to \mathbb R$ such that
$$\lim_{\langle s,t\rangle \to 0} \frac{f(a+s,b+t) - f(a,b) - L\langle s,t\rangle}{|\langle s,t\rangle|} = 0
$$
where the denominator is just the vector norm $|\langle s,t\rangle|=\sqrt{s^2+t^2}$.
Assuming that $f(x,y)$ is indeed differentiable at $(a,b)$, it is a theorem of calculus, which you should be able to find in any calculus book, that for any unit vector $\vec u = \langle s,t \rangle$, the directional derivative of $f$ in the direction $\vec u$ is equal to the value $L\langle s,t \rangle$. From this, one can define the tangent plane to be the graph of the function $z = f(a,b) + L\langle x,y\rangle$, and then it is a theorem that the slope of the graph of $f$ in any direction is equal to the slope of the tangent plane in that direction.
Furthermore, if you write the formula for the linear function $L$ in standard form like this:
$$L\langle x,y\rangle = cx + dy
$$
then it is a theorem that $c = \frac{\partial f}{\partial x}(a,b)$ and $d = \frac{\partial f}{\partial y}(a,b)$. From this you get the usual formula for the directional derivative at $(a,b)$, in the direction of a unit vector $\vec u = \langle s,t \rangle$, namely
$$\frac{\partial f}{\partial\vec u} = L\langle s,t\rangle = s \frac{\partial f}{\partial x} + t \frac{\partial f}{\partial y}
$$
That number is the slope --- both of the graph and of the tangent plane --- in the direction $\vec u$.
And to return to the example $f(r,\theta) = r \cos(3\theta)$, what goes wrong with this function is simply that it is not differentiable at $(0,0)$.
Best Answer
The line intersects the quadric at two points whose parameter values $s$ satisfy the equation $(\mathbf a + s\lambda)^T A (\mathbf a + s\lambda)=1$. If you expand this out, you’ll get a quadratic equation that gives you the two relevant values of $s$. If the line is actually tangent to the quadric, then the two intersection points will be coincident, so the quadratic will have equal roots. This will immediately give you the desired condition for tangency. In fact the quadratic “$b^2 = 4ac$“ condition that we all learned in high-school becomes: $$ 4(\lambda^TA \mathbf a)^2 = 4(\lambda^TA \lambda)(1 - \mathbf a^TA \mathbf a) $$ The second term on the right is zero because the point $\mathbf a$ lies on the quadric, so $\lambda^TA \mathbf a=0$.
As far as I know, no good books about quadrics have been written in the past 50 years or so. The best references I know are old books about 3D coordinate geometry. Look for authors like Sommerville, Snyder and Sisam, and Salmon.
Sommerville, Analytical Geometry of Three Dimensions.
Snyder & Sisam, Analytical Geometry of Space
Salmon, A Treatise on the Analytic Geometry of Three Dimensions