The spirit, which we usually call it as conscience in our daily life, actually belongs to God. Hence, it is perfect in nature. It has all virtues in itself and always guides us to do the right things. In other words, it always supports what God asks from us, and refrains us from what God bans for us. Since it belongs to God, it has the ability to punish our soul when the soul makes us to do something against the orders of God.
In common usage the concepts of "soul" and "spirit" are often taken as synonymous. In fact, the Holy Scriptures state otherwise. The original meaning of the word spirit in both Old Testament Hebrew and New Testament Greek was "breath" or "wind", which was bequeathed to "breathed into" man by God.
Bereshis 2: (OJB) breathed into his nostrils the nishmat chayyim (breath of life); and the adam became a nefesh chayyah (living soul).
Job 27/3 (KJV) All the while my breath is in me, and the spirit of God is in my nostrils;
Zech 12:1 KJV) … and formeth (shaped) the spirit of man within him.
As-Sajdah Qur’an 32/9 Then He designed him, breathed into him of His spirit.
Ash-Shams Qur’an 91/7 And the soul and the one who designed it.
The spirit does not stay in our physical body forever. In fact, it leaves the physical body either by death or submission to God before death. God wants us to return our spirit back to Him through soul purification before death.
Ecclesiastes 12:7 (NKJV) Then the dust will return to the earth as it was, and the spirit will return to God who gave it.
Genesis 6:3 (RSV) Then the LORD said, “My spirit shall not abide in man forever…”
1 Corinthians 6:19-20 (NKJV) Or do you not know that your body is the temple of the Holy Spirit who is in you, whom you have from God