I know the answer is $\pi$ there is a proof here. Now looking to my textbook (textbook image) the result should be $0$. Using the last equation on the right hand page we have: $$ i\pi(\sin^2(x))'|_{x=0} = 0 $$ and there are no other poles except $0$ so the result should be $0$.
What is the problem? Is the definition for principal value different in the two cases?
One may observe that, by the Taylor series expansion, as $x \to 0$, $$ \sin x=x+O(x^3) $$ giving $$ \frac{\sin^2 x}{x^2}=1+O(x^2), $$ on the other hand, as $x \to \infty$, $$ \left|\frac{\sin^2 x}{x^2}\right|\leq \frac1{x^2} $$ consequently the given integral is convergent: $$ 0<\int_{-\infty}^{+\infty}\frac{\sin^2 x}{x^2}\:dx<\infty. $$ No need to consider a principal value: there is no singularity of $\dfrac{\sin^2 x}{x^2}$ over $\mathbb{R}$.
We have
a proof of the latter integral evaluation may be found here.