formula 3.749.2 from Gradshteyn & Ryzhik gives:
$\int_0^{\infty}\frac{1-x{\rm cotan}x}{x^2+\epsilon^2}dx=\frac{\pi}{2\epsilon}-\frac{\pi}{e^{2\epsilon}-1}$, for $\epsilon>0$.
taking the limit $\epsilon\downarrow 0$ gives your $\pi/2$; G&R do not explicitly say that their formula is a principal value integral, but it's the only sensible way to avoid the poles of the cotangent at $\pi,2\pi,...$; note that there is no singularity at $x=0$, so the limit $\epsilon\downarrow 0$ gives no ambiguity.
Here's the derivation by contour integration, as I outlined in the comment below. The integral over $1/(x^2+\epsilon^2)$ is elementary, so I only do the one involving the cotangent:
$${\cal P}\int_{0}^{\infty}dx\frac{x\;{\rm cotan}x}{x^2+\epsilon^2}= \frac{1}{4}\lim_{\delta\rightarrow 0}\left(\int_{-\infty+i\delta}^{\infty+i\delta}dx\frac{x\;{\rm cotan}x}{x^2+\epsilon^2}+ \int_{-\infty-i\delta}^{\infty-i\delta}dx\frac{x\;{\rm cotan}x}{x^2+\epsilon^2}\right)$$
$$=\frac{1}{4}\lim_{\delta\rightarrow 0}\left(\int_{-\infty+i\delta}^{\infty+i\delta}\frac{dx}{\sin x}\frac{x\;e^{ix}}{x^2+\epsilon^2}+ \int_{-\infty-i\delta}^{\infty-i\delta}\frac{dx}{\sin x}\frac{x\;e^{-ix}}{x^2+\epsilon^2}\right)$$
$$=\frac{1}{4}\times 2\pi i\times 2\times \frac{1}{\sin i\epsilon}\frac{i\epsilon\;e^{-\epsilon}}{2i\epsilon}$$
$$=\frac{\pi}{e^{2\epsilon}-1}$$