Note that
$$
\begin{align}
\int_{-\infty}^\infty\frac{\sin(ax)}{x(1+x^2)}\,\mathrm{d}x
&=\color{#C00000}{\frac1{2i}\int_{\gamma_+}\frac{e^{iaz}}{z(1+z^2)}\,\mathrm{d}z}
-\color{#00A000}{\frac1{2i}\int_{\gamma_-}\frac{e^{-iaz}}{z(1+z^2)}\,\mathrm{d}z}\\
\end{align}
$$
where $\gamma_+=R[-1,1]-i\epsilon\cup Re^{i\pi[0,1]}-i\epsilon$ and $\gamma_-=R[-1,1]-i\epsilon\cup Re^{i\pi[0,-1]}-i\epsilon$
The residue of the integrand at $0$ is $1$. The residue at $i$ is $-e^{-a}/2$. The residue at $-i$ is also $-e^{-a}/2$. Since $\gamma_-$ is counterclockwise, we get the integral to be
$$
\frac{2\pi i}{2i}\left(\color{#C00000}{1-\frac{e^{-a}}{2}}-\color{#00A000}{\frac{e^{-a}}{2}}\right)=\pi\left(1-e^{-a}\right)
$$