Because Satan pretended to be a serpent, God went along with the charade. Of course, everyone in heaven knew what happened, but Adam and Eve could not have known and God did not reveal it. The offspring of the woman was a sacred secret too. No one knew who it would be or how it would all play out with the serpent biting the heel and the seed of the woman crushing the head of the serpent. It is noteworthy how little the Hebrew Scriptures say about Satan. Aside from the book of Job, Satan is only mentioned a couple of times.
But when Jesus came on the scene, he revealed that Satan was the father of the lie, thus connecting him to Eden. Further, when Jesus gave the Revelation to John, it was plainly stated that the original serpent was Satan, the Devil. So when God spoke to the "serpent," he was really speaking to Satan, telling him he was cursed and out of God's family of sons. He would be a contemptible, loathsome creature, crawling on his belly and licking up the dust, as it were, until the day that the seed of the woman crushes his head.