I guess it stems from Roman 16:20 - And the God of peace shall bruise Satan under your feet shortly.
And I believe there's thought to be some connexion with Genesis and the punishment God meted to the serpent:
And the LORD God said unto the woman, What is this that thou hast done? And the woman said, The serpent beguiled me, and I did eat.
And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle, and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:
And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.
We'll skip the question of whether the Serpent is Satan, but when I was trying to find that passage, entertaining vague connexions to the infant Hercules, I ran into another scriptural serpent.
And the LORD sent fiery serpents among the people, and they bit the people; and much people of Israel died.
Therefore the people came to Moses, and said, We have sinned, for we have spoken against the LORD, and against thee; pray unto the LORD, that he take away the serpents from us. And Moses prayed for the people.
And the LORD said unto Moses, Make thee a fiery serpent, and set it upon a pole: and it shall come to pass, that every one that is bitten, when he looketh upon it, shall live.
And Moses made a serpent of brass, and put it upon a pole, and it came to pass, that if a serpent had bitten any man, when he beheld the serpent of brass, he lived.
Sadly, King Hezekiah destroyed Moses' magic brass serpent, because people had recently(?) begun worshipping it as the god Nehushtan. (2 Kings 18:4)