Why all the zeroes at odd k?

In this example f(x) is an even function and as such in the orthogonal expansion it can only be made up of even functions, the even Legendre polynomials.

Recall that

Up to Example 1