The unclean foods and purity laws of Leviticus might seem at first glance seem to contradict the idea that morality is always a matter of someone's intentions (Lev. 11-16). After all, in Leviticus simply touching something makes you unclean. There are other instances where a person's intentions seem to be good and their touch gets them in trouble. In 2 Samuel 6, a man named Uzzah reaches out to steady the Ark of the Covenant and died immediately. Similarly, at Mt. Sinai, any animal that might have touched the mountain was to be killed (Exod. 19:13).
But as with all issues, we cannot simply appropriate one passage without consulting the rest of the Bible. Similarly, the books of the Bible are in everyday language and categories, which means that it does not express things with philosophical precision, just as it does not express things with scientific or what we would consider historical precision. When we turn to the New Testament, we find the apostle Paul saying that "I am fully convinced that no food is unclean in itself. But if anyone regards something as unclean, then for him it is unclean" (Rom. 14:14).
Paul's claim--quite surprising in the light of Leviticus--is that food in itself is morally neutral. It is the way a person thinks about the food--his or her moral intent--that makes the food clean or unclean. The matter itself is morally neutral. We can accommodate the Old Testament by saying that, during the period of the Old Testament, God considered certain foods and actions to be "unclean" in his dealings with Israel. But in the New Testament, God "declared all foods clean" (Mark 7:19), now making them clean.
Why did God consider them unclean? In itself this question potentially tells us a great deal about how God relates to the world. The instructions on animals with certain hooves or not having fins and scales seem ridiculous to us today. One explanation that has made sense to our modern mind is that these rules had to do with hygiene, and this explanation does go back at least to the time of Jesus.
However, explanations that make sense to us are as often as not anachronistic. A much more likely explanation in light of the ancient world is that these laws mirrored the way the ancient Israelites viewed the world in their socio-cultural context.  In other words, rather than God instituting arbitrary rules, these laws reflected God meeting the Israelites within the categories of their own day.
The food laws all imply a certain order to the Israelite world. Things in the sea should have fins and scales. Birds should fly. Blood is a power that should stay inside the body. Israelites are shepherds; other nations herd pigs. The holiness codes of Leviticus thus reflect the lines Israel drew around their world, just as all cultures draw lines and boundaries around their worlds.  These laws thus set Israel apart from the nations around them that served other gods. When the gospel expanded to the whole world, these boundaries became more of a hindrance than a help, and so the New Testament in effect revokes them.
But of course, though Paul takes this position on food, he does not say that everything is either clean or unclean because of how we think about it. For example, it is doubtful Paul would have talked about sexual immorality in this way. But again, Paul's writings are letters, not philosophy books. We can still extend the basic principle and account for what he says about sexual immorality in a more precise way.
The key is to bring God into the picture as we did with Leviticus. There, it was not the food that was moral in nature, but the fact that God at that time was declaring those foods unclean for Israel, meeting them within their categories, taking on their flesh, so to speak--incarnating the truth. It is thus possible that certain sexual actions would remain "unclean" in the New Testament era because God considered them unclean, regardless of the intentions of those involved (e.g., sleeping with your step-mother; 1 Cor. 5).
But we are arguing, once again, that it is not the act itself or things themselves that are unclean or morally wrong. Rather, it is either what God thinks about those acts and events or what we intend about those acts that makes them either morally good or evil. And here the principle is once again love. Can a person ever act in love toward his or her spouse and have an affair? Highly doubtful. Therefore, cheating on one's spouse is always a morally evil act--not because of the act itself, but because of the intention involved.
 See Mary Douglas, Purity and Danger.
 See The Social Construction of Reality