The Law of Moses taught the Israelites not to touch that which was physically unclean. Therefore, they were forbidden to touch a dead body whether human or animal without becoming "unclean." (Lev 5:2-3, Num 19:11) This doctrine was to teach them the difference between the clean and unclean objects of the physical world. The object was to serve as a metaphor for spiritual cleanliness, to remind them not to touch that which is spiritually unclean.
The scriptures also use the phrase, Go ye out from Babylon (DC 133:5). The Sunday School answer is that were are to be "in the world but not of the world." All of these concepts deal with the same subject. That is that the Lord wants us to be separate from the world and its filthiness. Paul taught almost the identical concept to the Corinthians, Wherefore come out from among them, and be ye separate, saith the Lord, and touch not the unclean thing (2 Cor 6:17).