Let $f(x) = \cos(a \tan x)$. We have $f(\pi -x) = f(x)$. Thus, we can reduce the integral as
$$
\int_{0}^{\infty} \dfrac{\sin x}{x} \cos(a \tan x)\operatorname{d}\!x = \int_{0}^{\frac{\pi}{2}}\cos(a \tan x)\operatorname{d}\!x.
$$
Let
\begin{align}
u &= \tan x \\
\operatorname{d}\!u &= \sec^2x\operatorname{d}\!x \\
\operatorname{d}\!x &= \dfrac{\operatorname{d}\!u}{1+u^2}
\end{align}
The integral becomes
$$
\int_{0}^{\infty} \dfrac{\cos(au)}{1+u^2}\,\operatorname{d}\!u
=\Re\left(\int_{0}^{\infty}\dfrac{e^{iau}}{1+u^2}\,\operatorname{d}\!u\right).
$$
Let us consider the complex function $f(z) = \dfrac{e^{iaz}}{1+z^2}$.
We choose a contour of the real axis from $-R$ to $R$ and a semicircular arc $(\Gamma_r)$ from $z = R$ to $z=-R$.
The poles are $\pm i$. But we will consider only $z=i$, as it is the only one inside our contour.
So, we have
$$
\operatorname{Res}(f,i) = \lim_{z \to i}(z-i)f(z) = \lim_{z \to i} \dfrac{e^{iaz}}{z+i} = \dfrac{e^{-a}}{2i}
$$
From here, we have
$$
\int_{-\infty}^{\infty} \dfrac{e^{iaz}}{1+z^2}\,\operatorname{d}\!z = 2\pi i \dfrac{e^{-a}}{2i} = \pi e^{-a}
$$
Since $\sin ax$ is odd, it's contribution is $0$, so we consider only $\cos ax$.
$$
\int_{-\infty}^{\infty}\dfrac{e^{iax}}{1+x^2}\,\operatorname{d}\!x = 2 \int_{0}^{\infty} \dfrac{\cos ax}{1+x^2}\,\operatorname{d}\!x = \pi e^{-a}
$$
Thus, our result should be:
$$
I(a) = \dfrac{\pi}{2} e^{-a}
$$
I hope someone can point out my mistakes, if any.