From the International Standard Bible Encyclopedia's article on Gnosticism, comes the following, which I've highlighted and modified here and there:
In the First Epistle of John there is a distinct polemical purpose. There is no book of the New Testament which is more purposeful in its attack of error. There is "the spirit of error" (1 John 4:6), opposing the Spirit of truth. "Many false prophets are gone out into the world" (1 John 4:1), and this from the church itself, "They went out from us, but they were not of us" (1 John 2:19); and these false prophets are distinctly named "the antichrist" (1 John 2:22) and "the liar" (same place), and "the deceiver and the antichrist" (2 John 1:7). This peril, against which the apostle writes, and from which he seeks to defend the church, was Gnosticism, as is proved by what is said again and again in the epistle of the characteristics of this insidious and deadly teaching.
(1) Gnostic Claims.
The Gnostic claim to knowledge throws light upon many passages in this epistle. John refers to his opponents' using such phrases as "I know God," "I abide in Christ," "I am in the light." These lofty claims were made by persons who did not love their brethren on earth, who did not walk in Christ's footsteps, and who were destitute of love. The apostle therefore describes these lofty claims as false, because those who made them possessed neither love nor obedience.
In contrast to these Gnostic claims—for those who made them were no other than the early Gnostics—John shows how the Christ of history is the Christ of experience, for those to whom he is writing know Christ, who is from the beginning, and they know the Father.
We know him that is true, and we are in him that is true, even in his Son Jesus Christ. This is the true God and eternal life. (1 John 5:20)
This knowledge of God and communion with Him are attained, not by Gnostic speculation, but by the obedience of faith, the outcome of which is brotherly love and a life in which the Christian walks even as Christ did (1 John 2:6). And thus also obedience and brotherly love are the test of the profession which any man may make that he knows God.
Every one also that doeth righteousness is begotten of him. (1 John 2:29)
Whosoever doeth not righteousness is not of God, neither he that loveth not his brother. (1 John 3:10)
(2) Its Loveless Nature.
Gnosticism was distinguished by an unethical, loveless intellectualism. This seems to be the explanation of the false teaching against which this epistle is directed. The apostle describes the dry head-knowledge which left the heart and life untouched by love, and which led men, while they professed to love God, nevertheless to remain destitute of love to their fellow-men. (They did not fold their human brethren to their hearts, they were dead to the fact that where pity dwells, the love of God dwells also. In Gnosticism knowledge was in itself the supreme end and purpose of life, the sum of highest good to which a man could attain, the crown of life. The system was loveless to the core.
Now, when the attempt was made to amalgamate these Gnostic ideas with the Christian faith, the inevitable result was Docetism. [The heresy of "docetism," from the Greek verb "to seem," was a denial of the Christian doctrine of the incarnation—the belief that Jesus was both fully God and fully human. The Gnostics went even further: they also denied the bodily resurrection of Jesus (taken from Derrick G. Jeter, "Dealing with Deceivers," Lesson Eight, in Living Right in a Wrong World Learn Online).] According to the Gnostics, if God cannot have any immediate contact with matter, the incarnation of Almighty God in the person of the Lord Jesus Christ is therefore inconceivable. From this position it is, of course, only a step to deny that the incarnation and the true human life of Christ ever took place at all.
(4) The Antichrist.
The Antichrist of the First Epistle of John is docetic Gnosticism. The soul of the apostle rushes onward, with glowing zeal for the honor of his Master whom Gnosticism dishonored, to identify personally the historical Jesus with the Divine Being, "the Son of God," "the Word of Life," "the Christ."
Who is the liar but he that denieth that Jesus is the Christ? This is the antichrist, even he that denieth the Father and the Son. Whosoever denieth the Son, the same hath not the Father: he that confesseth the Son hath the Father also. (1John 2:22, 23)
It should be noted that the last clause in 1 John 2:23, which is printed in italics in the King James Version, is restored in the Revised Version (British and American) to its rightful position in the original text.
Every spirit that confesseth that Jesus Christ is come in the flesh is of God: and every spirit that confesseth not Jesus is not of God: and this is the spirit of the antichrist, whereof ye have heard that it cometh; and now it is in the world already. (1 John 4:2, 3)
(5) Its Antinomian Side.
The antinomian side of Gnosticism is not so directly referred to in the First Epistle of John as Docetism is; but evidences are manifest that the apostle had it clearly before him.
Little children, let no man lead you astray: he that doeth righteousness is righteous, even as he is righteous: he that doeth sin is of the devil. (1 John 3:7, 8)
And these were the methods by which those deceivers endeavored to lead the members of the church astray. They alleged that sin was a thing indifferent in itself. It made no difference to the spiritual man whether he sinned with his body or not. It is for this reason that the apostle, in opposing those teachers, insists that "sin is lawlessness" (1 John 3:4); "All unrighteousness is sin" (1 John 5:17); "Whosoever is begotten of God doeth no sin" (1 John 3:9); "In this the children of God are manifest, and the children of the devil: whosoever doeth not righteousness is not of God, neither he that loveth not his brother" (1 John 3:10). The whole passage presupposes, as familiar to its readers, a doctrine of moral indifferentism, according to which the status of the `spiritual' man is not to be tested by the commonplace facts of moral conduct" (The Tests of Life, 34).