Short Answer: No, Docetism was not a necessary feature of Gnosticism (or even the Christian variety of Gnosticism.) It was however, a very popular solution for Gnostics, who necessarily held that God cannot interact directly with the material world.
Gnosticism held that the material world was evil and the spiritual world was holy. At first glance this might sound semi-Christian, but here are a few key implications of Gnosicism:
A holy God could not possibly have any association with the wicked material realm. Thus, He could not have created the physical realm, nor could He directly interact with it, let alone come and be encased in it.
The goal was to escape the physical realm (through the layers of intermediary states) to the spiritual realm. The idea of a physical resurrection was absolutely appalling to Gnostics. Why would you want to be raised back up into the disgusting, wicked, base elements that you had finally been freed from upon death?
Docetism was one way of reconciling Gnostic philosophy with Christianity. Yes, Jesus was God, they would say, but He most certainly was not a real, physical man. Nor did He die, and He most certainly did not raise up in a physical body.
Arianism (including Socianism) would be the other obvious solution for the Gnostic Christian. Yes, they would say, Jesus was a real man, but He most certainly was not God.
There were other fringe solutions as well, such as the idea that Jesus was something in between God and man, but Docetism and Arianism were by far the most prominent solutions.