Then answered the Jews and said unto him, What sign shewest thou unto us, seeing that thou doest these things? Jesus answered and said unto them, Destroy this temple, and in three days I will raise it up. Then said the Jews, Forty and six years was this temple in building , and wilt thou rear it up in three days? But he spake of the temple of his body. When therefore he was risen from the dead, his disciples remembered that he had said this unto them; and they believed the scripture, and the word which Jesus had said. - John 2:18-22
Paul uses the temple metaphor for the membership of the church as a whole:
Now therefore ye are no more strangers and foreigners, but fellowcitizens with the saints, and of the household of God; And are built upon the foundation of the apostles and prophets, Jesus Christ himself being the chief corner stone; In whom all the building fitly framed together groweth unto an holy temple in the Lord: In whom ye also are builded together for an habitation of God through the Spirit. - Ephesians 2:19-22
Here Paul is addressing the church at Corinth, so the "you" is plural:
Know ye not that ye are the temple of God, and that the Spirit of God dwelleth in you? If any man defile the temple of God, him shall God destroy; for the temple of God is holy, which temple ye are. - 1 Corinthians 3:16-17
So all the members of the church together form the temple and the Spirit of God dwells within. If that's the case, how does one defile the temple of God? One traditional interpretation is that tattoos and body piercing are forbidden. However, the Bible never forbids body piercing and only forbids tattoos indirectly in that they can be considered graven images. One could make the argument that since we are created in God's image, modifying our bodies is an insult to God (with the one notable exception of circumcision).
Another interpretation of the phrase is we should be physically fit. Smoking, drinking, over eating, and anything else that makes us less physically fit is a defilement of our bodies. We should make our bodies as perfect as possible through diet and exercise just as we would want our place of worship to be perfect and without flaw.
Other people think that when the scriptures compare our bodies to temples it means that abortion is forbidden. However, abortion is never condemned in the Bible (unless you count the Apocrypha).
My own theory about this phrase involves looking at when the scriptures were written. According to tradition, the Pauline epistles were written between 50-70 AD, however there's no evidence of their existence until the second century. If they are second century creations, the epistles were written after the Temple of Jerusalem was destroyed by Titus in 70 AD. The Temple was the only place where God was said to have dwelt.
Theology had to change once the Temple was destroyed. The practice of animal sacrifice was stopped. (Today, modern Jews argue whether the practice should continue if the Temple gets rebuilt.) Also, the idea that God dwelt only in the Temple had to change.
"Lift the stone and there you will find me. Split the wood and I am there." - Thomas 30
Now, instead of only being able to commune with God at the Temple in Jerusalem, Christian Jews could commune with God anywhere. God was no longer limited to a single building. Every member's body was now a temple. (Even if the epistles were written before the Temple was destroyed, the idea that God dwelt everywhere could have been arrived at by Christian Jews who were barred from the Temple.)
So my theory was that when early Christians speak of the body being a temple, they mean that you can worship God wherever you are. You don't have to go to a special building designed for worship. Wherever you go, God goes also. My theory might even be what the phrase originally meant, unfortunately it's not backed up by the scriptures as we have them today.
Flee fornication. Every sin that a man doeth is without the body; but he that committeth fornication sinneth against his own body. What? know ye not that your body is the temple of the Holy Ghost which is in you, which ye have of God, and ye are not your own? For ye are bought with a price: therefore glorify God in your body, and in your spirit, which are God's. - 1 Corinthians 6:18–20
That's right. When Paul talks about the body being a temple, what he really means is that you shouldn't have sex. How disappointing.