1) The necrophile develops poor self-esteem, perhaps due in part to a significant loss;
(a) He (usually male) is very fearful of rejection by women and he desires a sexual partner who is incapable of rejecting him; and/or
(b) He is fearful of the dead, and transforms his fear of the dead—by means of reaction formation—into a desire for the dead.
(2) He develops an exciting fantasy of sex with a corpse, sometimes after exposure to a corpse.
"Jeffery screwed a corpse last night."
"Omg, He engaged in necrophilia?"
"yeah, he said it was fun"