Some care must be taken when trying evaluating this integral. Fist consider the partial integrals
$$\int_a^b \frac{e^{-x^2} - e^{-x}}{x}\, dx \quad (b > a > 0).$$
We have
$$\int_a^b \frac{e^{-x^2} - e^{-x}}{x}\, dx = \int_a^b \frac{e^{-x^2}}{x}\, dx - \int_a^b \frac{e^{-x}}{x}\, dx = \frac{1}{2}\int_{a^2}^{b^2} \frac{e^{-u}}{u}\, du - \int_a^b \frac{e^{-x}}{x}\, dx,$$
using the substitution $u = x^2$. By integration by parts,
$$\int_a^b \frac{e^{-x}}{x}\, dx = e^{-b}\ln b - e^{-a}\ln a + \int_a^b e^{-x}\ln x\, dx$$
and
$$\frac{1}{2}\int_{a^2}^{b^2} \frac{e^{-u}}{u}\, du = e^{-b^2}\ln b - e^{-a^2}\ln a + \frac{1}{2}\int_{a^2}^{b^2} e^{-x}\ln x\, dx.$$
Therefore
\begin{align}&\int_a^b \frac{e^{-x^2} - e^{-x}}{x}\, dx\\
& = (e^{-b^2} - e^{-b})\ln b - (e^{-a^2} - e^{-a})\ln a + \frac{1}{2}\int_{a^2}^{b^2} e^{-x}\ln x\, dx - \int_a^b e^{-x}\ln x\, dx.\\
\end{align}
Since $(e^{-x^2} - e^{-x})\ln x$ tends to $0$ as $x\to 0^+$ and as $x\to \infty$, taking the limit as $a \to 0^+$ and $b\to \infty$ results in
$$\int_0^\infty \frac{e^{-x^2} - e^{-x}}{x}\, dx = -\frac{1}{2}\int_0^\infty e^{-x}\ln x\, dx = \frac{1}{2}\gamma,$$
where $\gamma$ is the Euler-Mascheroni constant.