Dr. Michael Heiser, a scholar in Old Testament and the Ancient Near East, wrote this article Why Would Jesus Compare Himself to a Snake? explaining how the serpent reference in Genesis 3 is NOT the same as the serpent reference in Numbers 21:
We might incorrectly link the serpent on the pole (Num 21) and the serpent in the garden (Gen 3), but the only similarity between these two passages is the word “serpent” (נחש, nachash). The nachash of Genesis 3 is a figure acting independently of—and in opposition to—the will of God. In Numbers 21 the biting serpents are God’s instrument of judgment for sin, and the nachash on the pole is God’s instrument of healing for those punished for sin.
Then he explored 3 possible explanations why God used the serpent symbolism in Numbers 21:
He concluded with Jesus's use of this passage:
Some of these messages are conveyed in both Numbers 21 and John 3:14–15. First, Yahweh was not a God with which to trifle. He could punish faithlessness by commanding the forces of nature—sending venomous serpents against the Israelites. But He also had the power to reverse the effects, offering His divine healing through a bronze serpent. Healing came with one condition: The Israelites had to exercise faith in the offer.
Jesus’ use of this test of the “obedience of faith” creates a fitting analogy to His own destiny. Death, the natural world’s most consuming force, would be reversed for all who looked to Jesus, raised up on the pole of the cross—if only the afflicted would believe.