Paul uses the analogy of a tent for the human body. This analogy was not Paul's creation but God's. In the Old Testament, God told Moses and the children of Israel to build a special tent for Him to dwell in. [Exodus 35]

This was a temporary structure that was used during their time in the wilderness. Once they had gotten to the promise land, the Lord instructed them to build a far more glorious and permanent structure.

The tabernacle in the wilderness and the temple in Jerusalem were types and shadows of a spiritual truth that God wants us to see.

"Or do you not know that your body is the temple of the Holy Spirit who is in you, whom you have from God, and you are not your own?" - 1 Corinthians 6:19

Under the old covenant, God dwelt in tents and temples but under the new covenant He wants to dwell in us.

2 Corinthians 5:1