Who was greater than Joseph the Tzaddik, who was connected to Eretz Yisrael with the characteristics of Tzadik (i.e. yesod) and Tzedek ["righteousness"] and was never under the control of the evil spirit? Despite that, being that his soul departed from him outside of Eretz Yisrael, he didn't want to enter Eretz Yisrael until his flesh would decompose and all that would remain of him would be bones. For the forces of evil can only attach themselves to the flesh and blood, even of evildoers. How much more so regarding the tzadikim in their death.

Likewise all those that live outside Eretz Yisrael, even if they are such great tzadikim as Joseph was, they would still be better off living in Eretz Yisrael. If they don't come to live [in Israel], it is prohibited for their bodies to be brought to Eretz Yisrael posthumously, until their flesh has decomposed and all that remains of the physical are bones. Upon the bringing of bones, the verse "And you shall come and defile My land" doesn't apply. Rather it applies to bones that are brought with flesh. For after the flesh is decomposed, G‑d blows a spirit and it pushes out any evil forces, for G‑d has pity for the land. All this is written in the Zohar. (parashat Teruma p. 141)

For both the righteous and the wicked, there is benefit in the decomposition of the flesh….

Yet despite the above explanation we are left with a strong question. If so, then why did our patriarch Jacob, of blessed memory, command that his children bring his [entire] body to be buried, as opposed to Joseph 's bones? The answer is that Jacob was unique, nobody who ever existed could be compared to him, for he was complete, in all aspects of life. His twelve sons and the seventy souls were exactly parallel to the Divine Chariot of the Shechina. That's why he commanded them, that nobody, aside from his children, should touch his coffin, in order that no spirit of defilement shall descend upon him. (Bereishit Rabba 100:2)

And how did he attain this level? The answer is based on the following: Abraham, Isaac, and all the other tzadikim had not perfected the chaos resulting from Adam's sin, except in partial form (corresponding to a limb or parts of the body), whereas Jacob rectified the entire body [of Adams sin]. His whole essence was purged of any forces of defilement. The putridity of the primordial snake was expelled from him, manifested by his attaining the blessing [from Isaac] and the birth-rite [from Esau] and subjugated the angel 'Satan' (as mentioned in parashat Toldot). Therefore the spirit of evil and the defilement of the primordial snake were absolutely removed from him. That is why he had no fear at all.

Another proof explained in the Zohar is that for both the righteous and the wicked, there is benefit in the decomposition of the flesh. For the individual won't merit entering into his own domain until his physical body disintegrates. This raises a question as to why Joseph ordered that Jacob be embalmed. Yet with what we have mentioned above there is no problem, for Jacob didn't need to have his flesh decayed; on the contrary he was to remain totally intact, for he embodied absolute and complete pristine holiness.

Know, that all of the sin of Adam, the physical existence, it's actions and pleasures - all stem from the primordial snake. For through the Sin, they became physical, after being spiritual with an intellectual connection to the wisdom of G‑d. Therefore an wise person who pushes off all lusts and only partakes of the material world his bare necessities [without intention for the pleasures involved], will not be infected by physical impurity, as well as ailments of the physical nature. The only cause of his death stems from the poison of the Snake, that has been transferred down to him from the sin of Adam, not his own shortcomings. Nonetheless, those people who indulge in the pleasures of this world and its lusts add to the poison of the Snake. It's as if they are renewing within themselves the sin of Adam. Therefore they die their own deaths.