2. Let $\alpha, \beta$ be acute angles. When
$$
-\frac{1}{\cos ^{2} \alpha}+\frac{1}{\sin ^{2} \alpha \sin ^{2} \beta \cos ^{2} \beta}
$$

takes the minimum value, the value of $\operatorname{tg}^{2} \alpha+\operatorname{tg}^{2} \beta$ is
To find the minimum value of the original expression, we need
$$
\sin ^{2} \beta \cos ^{2} \beta=\frac{1}{4} \sin ^{2} 2 \beta
$$

to take the maximum value. Since $\beta$ is an acute angle, we know $\beta=\frac{\pi}{4}$.
When $\beta=\frac{\pi}{4}$,
$$
\begin{aligned}
\text { the original expression } & \geqslant \frac{1}{\cos ^{2} \alpha}+\frac{4}{\sin ^{2} \alpha} \\
& =\left(\frac{1}{\cos ^{2} \alpha}+\frac{4}{\sin ^{2} \alpha}\right)\left(\cos ^{2} \alpha+\sin ^{2} \alpha\right) \\
& =1+\tan^{2} \alpha+\frac{4}{\tan^{2} \alpha}+4 \\
& \geqslant 1+4+4=9 .
\end{aligned}
$$

When the product of the terms is a constant, the minimum value of their sum is
$$
\tan^{2} \alpha+\frac{4}{\tan^{2} \alpha} \geqslant 4
$$

The equality holds if and only if
$$
\tan^{2} \alpha=\frac{4}{\tan^{2} \alpha}
$$

which gives $\tan^{2} \alpha=2$. Therefore,
$$
\tan^{2} \alpha+\tan^{2} \beta=2+1=3 .
$$