The line gets infinitely large as we approach $x = 0$, yes, however it also gets infinitely close to the $y$-axis, so the area added, is actually finite. The area under the curve is dependent on both the width and height of the rectangles under, and as such if either dimension grows without bound, the other has the tend to $0$ fast enough as well (for the integral to converge).
There is some tension between the height and the width. Let me explain. Let $0<p<1$, then the integral
$$\int_0^1 \frac{1}{x^p}\,\mathrm d x $$
converges. Remember that your example is just with $p = 1/2$, because $x^{1/2} = \sqrt{x}.$ Now if $p \geq 1$, the integral actually diverges. So there is a turning point at $p = 1$, where the width doesn't decrease quite fast enough. This is because for $0<p<1$, we have that
$$\int_0^1\frac{1}{x^p}\,\mathrm{d}x = \frac{1}{1-p},$$
from which it is quite easy to see that the value blows up as $p\to 1$.
Consider now the integral
$$\int_1^\infty\frac{1}{x^p}\,\mathrm{d}x$$
which converges for exactly $p>1$. In this case, if $0<p\leq1$, then it is the height of the curve as $x\to \infty$ that doesn't go to zero quite fast enough, and hence the integral diverges. For $p>1$ we have that
$$\int_1^\infty\frac{1}{x^p}\,\mathrm{d}x = \frac{1}{p-1},$$
and again it is simple to see that this blows up as $p\to 1$.
The interesting thing is that both of these integrals diverge exactly when $p = 1$, and so this is the point where both the height as $x\to \infty$ and the width $x\to 0^+$ does not get small quickly enough. For all values of $0<p<\infty$ except $p = 1$ one of the integrals converges.