This is an important scripture because it is in fulfilment of a prophecy in the Old Testament.
They part my garments among them, and cast lots upon my vesture.
The same story in John talks about this prophecy and gives us a clearer picture.
23 Then the soldiers, when they had crucified Jesus, took his garments, and made four parts, to every soldier a part; and also his coat: now the coat was without seam, woven from the top throughout.
24 They said therefore among themselves, Let us not rend it, but cast lots for it, whose it shall be: that the scripture might be fulfilled, which saith, They parted my raiment among them, and for my vesture they did cast lots. These things therefore the soldiers did.
Here we can see that there were probably four soldiers, as His garments was made into four part. There was no need to cast lots for this garments as they were divided equally. What they cast lots for (to get possession of) was his vesture or his coat, which was said to be without seam, woven from the top throughout.
You know what this tells me? Jesus was not what people think He was: a poor pauper who was dressed shabbily. No, He could pay taxes for His disciples as well. He could feed five thousand men and even more women and children. But He became poor at the Cross.
[2 Corinthians 8:9]
For ye know the grace of our Lord Jesus Christ, that, though he was rich, yet for your sakes he became poor, that ye through his poverty might be rich.
What I believe this scripture means is that God was stripped of everything, including His coat, His raiments for many reasons. But it tells us that He was rich yet for our sakes He became poor that we through His poverty may become rich.
It was one of the great exchanges on the Cross which we can claim.