Biblical "uncleanness" (tumah) isn't necessarily caused by sin, but by a loss of life force (nephesh behemah). The greater the loss of nephesh behemah, the greater the resulting tumah. A dead human is more tamei than a dead animal because a greater level of nephesh behemah has been lost. Unclean spirits might be "unclean" because they possess negative life force.