If you use the Cartesian coordinate, you should recall the definition of "improper integral". Let me give you a simpler example here, consider $\int_0^1\frac{1}{\sqrt{x}}dx$, the integrand approaches infinity as $x\to 0$, however, the "improper integral " defines it as a limit, i.e., $\int_0^1\frac{1}{\sqrt{x}}dx=\lim_{\epsilon\to0}\int_{\epsilon}^1\frac{1}{\sqrt{x}}dx=\lim_{\epsilon\to0}2\sqrt{x}\big|_{\epsilon}^1=2$, thus the integral will still give you a finite value. Note that if the singularity is even stronger, you may consider the Cauchy principle value. But this integrand has the singularity type $1/r^2$, in 3D, this integral is just weakly singular, so probably you do not even need to use the principle value.