This is the infamous "Euler-Product Formula" that started the entire Riemann hypothesis thing being connected to prime numbers.

The infinite product in this case is the same as the infinite sum of all integral square, namely the zeta function evaluated at 2.

Thus, (and I think you meant this)

$\displaystyle \prod _p(1-p^{-2})^{-1}=\zeta (2)=\frac{\pi^2}{6}$.

Hence, pi appears in this expression.