1 And the Lord spoke to Moses, saying, 2 “Speak to all the congregation of the children of Israel, and say to them: ‘You shall be holy, for I the Lord your God am holy. -Leviticus 19:1-2 (NKJV)
God always wants His people to be holy--clean and undefiled. Leviticus 11 contains prohibitions against eating certain things (camels, rabits, pigs, etc.) that make a man unclean. And Leviticus 18 contains prohibitions against certain types of sexual relations that defile a man. When a man is unclean or defiled, he is no longer holy:
Do not defile yourselves [make yourselves unclean/unholy] with any of these things; for by all these the nations are defiled [unclean/unholy], which I am casting out before you. -Leviticus 18:24 (NKJV)
The tabernacle was made holy after anointing it with oil:
And you shall take the anointing oil, and anoint the tabernacle and all that is in it; and you shall hallow it and all its utensils, and it shall be holy. -Exodus 40:9 (NKJV)
The tabernacle later became the temple which was also holy:
O God, the nations have come into Your inheritance;
Your holy temple they have defiled [made unclean/unholy];
They have laid Jerusalem in heaps. -Psalm 79:1 (NKJV)
The temple was holy just as God is holy, and as God's people were to be holy. Even touching an unclean thing, such as a carcass of an unclean animal, caused you to become unclean [unholy] and required a trespass offering of a female lamb or goat; or if you were poor, two turtledoves or two young pigeons; or if you were really poor, one-tenth of an ephah of fine flour (Leviticus 5:2, 5-7, 11).
Touching a dead body also made you unclean for seven days and required you to purify yourself with water in Numbers 19. It is here where the body is directly referred to as the tabernacle (which would later become the temple) and sanctuary (holy place of the Lord):
Whoever touches the body of anyone who has died, and does not purify himself, defiles the tabernacle of the Lord. That person shall be cut off from Israel.... -Numbers 19:13 (NKJV)
But the man who is unclean and does not purify himself, that person shall be cut off from among the assembly, because he has defiled the sanctuary of the Lord.... -Numbers 19:20 (NKJV)
Isaiah 8:13-14 (NKJV) also makes a direct comparison of the Lord being as a sanctuary:
13 The Lord of hosts, Him you shall hallow;
Let Him be your fear,
And let Him be your dread.
14 He will be as a sanctuary,
But a stone of stumbling and a rock of offense
To both the houses of Israel,
As a trap and a snare to the inhabitants of Jerusalem.