When are definite integrals undefined?
As mentioned in the comments, $\delta$ is not a function in the classical sense, but a distribution. For simplification you can think of it as a definition that $\int f(x)\delta(x)\,dx = f(0)$.
But be careful because in the if you define a classical function $$\hat \delta(x) = \begin{cases} 0 & x\ne 0 \\ \infty & x = 0{}\end{cases}$$ as a classical function then for all integrable functions $f$ we get: $\int f(x)\hat\delta(x)\,dx = 0$ since $\hat\delta$ is zero almost everywhere and therefore $f\cdot\hat\delta$ is zero almost everywhere.
To further understand why you could say that this equation is kind of valid for the dirac distribution, you need a fundamental understanding of measure theory and functional analysis.
If you have a basic background in measure theory, you can understand the delta distribution as the extended radon-nikodym-derivative of the dirac measure and the lebesgue measure.
In the physics-y spirit of the question: The "$\delta$-function" (which, as Zachary comments, is not a real-valued function) has finite integral even if "the value at one point is infinite".
By contrast, the integral $\int_{-1}^{1} \frac{1}{x}\, dx$ is undefined (as an improper Riemann integral) because the limits $$ \lim_{a \to 0^{-}} \int_{-1}^{a} \frac{1}{x}\, dx = \lim_{a \to 0^{-}} \ln(-a),\qquad \lim_{b \to 0^{+}} \int_{b}^{1} \frac{1}{x}\, dx = -\lim_{b \to 0^{+}} \ln b $$ formally give the indeterminate expression $$ \int_{-1}^{1} \frac{1}{x}\, dx = \infty - \infty. $$ Geometrically, the region under the graph $y = \frac{1}{x}$ for $0 \leq x \leq 1$ has infinite area, and the region above the graph $y = \frac{1}{x}$ for $-1 \leq x \leq 0$ has infinite area.
Though "the reciprocal function and the $\delta$-function are both infinite at one point", their respective behaviors differ with respect to integration over an arbitrarily small neighborhood of $0$.
Don't believe everyone telling you that you need to know functional analysis or measure theory... you just need to use the appropriate definition for $\delta$:
\begin{align*} \delta(x) &= \frac{1}{2}\,\operatorname{sgn}'(x) \\ \int_{-1}^{1} f(x)\,\delta(x)\,dx &= \int_{-1}^{1} f(x)\,\frac{\operatorname{sgn}'(x)}{2}\,dx \\ &= \left.f(x)\operatorname{sgn}(x)\right|_{-1}^{+1} - \int_{-1}^{1} \frac{\operatorname{sgn}(x)}{2}\,f'(x)\,dx \\ &= \frac{f(1)+f(-1)}{2} + \int_{-1}^{0} \frac{f'(x)}{2}\,dx - \int_{0}^{1} \frac{f'(x)}{2}\,dx \\ &= \frac{f(1)+f(-1)}{2} + f(0) - \frac{f(-1)+f(1)}{2} \\ &= f(0) \end{align*}
Note the following:
You don't actually need $f$ to be differentiable. If it can be approximated arbitrarily well by a differentiable function, the same arguments here work.
You don't need $\operatorname{sgn}$ to be the sign function. Just pretend it's a smooth approximation whose behavior only changes very close to the zero. Again, the proof holds just fine in that case, and as the approximation gets better, the error vanishes.
You don't need to know measure theory or functional analysis to understand any of this intuitively.