\begin{align}
& \int_{-1}^0 \frac{dx} x = -\infty, \\[10pt]
& \int_0^1 \frac{dx} x = +\infty, \\[10pt]
& \lim_{\varepsilon \, \downarrow \, 0} \left( \int_{-1}^{-\varepsilon} \frac{dx} x + \int_\varepsilon^1 \frac{dx} x \right) = \lim_{\varepsilon\,\downarrow\,0} \left( \log_e \varepsilon -\log_e \varepsilon \right) = 0, \tag 1 \\[10pt]
& \lim_{\varepsilon\,\downarrow\,0} \left( \int_{-1}^{-\varepsilon} \frac{dx} x - \int_{2\varepsilon}^1 \frac{dx} x \right) = \lim_{\varepsilon\,\downarrow\,0} (\log_e \varepsilon - {}\log_e (2\varepsilon)) = \log_e \frac 1 2 \ne 0. \tag 2
\end{align}
When the positive and negative parts are both infinite, then "rearrangements" of this sort can alter tha value of the integral. The result in $(1)$ is the "Cauchy principal value" of the integral from $-1$ to $1.$
$$
\int_{-\infty}^\infty \delta(x)\,dx = 1.
$$
With the delta function, the positive part of the value of the integral is finite and the negative part is zero -- hence finite.
But notice that
$$
\int_{-\infty}^\infty \Big( 3\delta(x) \Big) \, dx = 3,
$$
so if one says that $\delta(0) = \infty,$ then one would have $\delta(0) = 3\cdot\infty = \text{what?}$ And here the answer is that the delta function is not a "function" in the sense of something that returns an output for each input; rather it is characterized by the values of the integrals of products $f(x)\delta(x)$ where $f$ actually is a function in that sense.