This is discussed in the Gatherer rulings for Animate Dead:
If the creature card put onto the battlefield has Protection from Black (or anything that prevents this from legally being attached), this won't be able to attach to it. Then this will go to the graveyard as a State-Based Action, causing the creature to be sacrificed.
The Dead will return the creature with protection from black, but the Dead can't attach to it (not even for an instant). The Dead will go to the graveyard and its leave the battlefield ability will trigger, and when it resolves, you'll sacrifice the creature with protection from black. Same thing with gods. The Dead can't attach to the noncreature god and will go to the graveyard, and then the god will be sacrificed.
Nathan Long
Wizards.Com Boards NetRep