Let
$\Omega\subset\mathbb{R}^N$,
$N\geq 1$, be an open bounded connected set. We consider the indefinite weighted eigenvalue problem
$-\Delta u =\lambda m u$ in Ω with
$\lambda \in \mathbb{R}$,
$m\in L^\infty(\Omega)$ and with homogeneous Neumann boundary conditions. We study weak* continuity, convexity and Gâteaux differentiability of the map
$m\mapsto1/\lambda_1(m)$, where
$\lambda_1(m)$ is the principal eigenvalue. Then, denoting by
$\mathcal{G}(m_0)$ the class of rearrangements of a fixed weight m0, under the assumptions that m0 is positive on a set of positive Lebesgue measure and
$\int_\Omega m_0\,dx \lt 0$, we prove the existence and a characterization of minimizers of
$\lambda_1(m)$ and the non-existence of maximizers. Finally, we show that, if Ω is a cylinder, then every minimizer is monotone with respect to the direction of the generatrix. In the context of the population dynamics, this kind of problems arise from the question of determining the optimal spatial location of favourable and unfavourable habitats for a population to survive.