This belief is most commonly attributed to the Gnostics, who believed that matter was evil, and hence that God would not take on a material body. This sort of statement, however, does not do justice to the so-called docetism of the gnostics. It could be further explained as this - the human body is temporary, and the spirit is eternal—therefore, to say that the body of Jesus was an illusion and that his crucifixion was as well, could be compared to the same way a Buddhist speaks about illusion: illusion is everything that is temporary, not everything that is not real. Even so, saying that the human body is temporary has a tendency to undercut the importance of the belief in resurrection of the dead and the goodness of created matter, and is in opposition to this orthodox view.
Docetism was rejected by the ecumenical councils and mainstream Christianity, and largely died out during the first millennium A.D. Catharism incorporated docetism into its beliefs, but that movement was destroyed by the Albigensian Crusade.
See also: Christology, Avatar