On a singular eigenvalue problem and its applications in computing the Morse index of solutions to semilinear PDE's