The imperfect immunization includes immune failure and immune invalidity on complex networks. In this paper, based on mean-field theory, we propose a new susceptible-infected-removed model to study epidemic spreading in networks with both immune failure and immune invalidity. Theoretical analysis shows that the immune failure and immune invalidity can significantly reduce the epidemic threshold and enhance the epidemic prevalence in the networks. According to the relationships between epidemic threshold, immune density of nodes, immune success rate and immune invalid rate, some suggestions on how to effectively control the propagation of epidemics are presented. Numerical simulations have confirmed the theoretical results.