On a class of singular semilinear equations