Yes, the soul is a literal piece of Godliness, but in order to descend into this world, it needs to be clothed in a vessel, a body. Like water, the soul takes on the "shape" of its container. When the body is holy, the soul is holy, when the body is twisted, the soul becomes twisted.
We each have a fragment of infinity within us, but how it manifests is entirely dependent on our thoughts, our speech and our actions.
[based on the Pri Ha'aretz, parashath Beha'alotcha and Shelach L'cha.]