The book "Good and Evil"
The origin of evil
I am not going to present in a few pages a full treatment of the viewpoint of The Secret Doctrine on the origin of Evil. But I will try to present some of my understanding.
“The ABSOLUTE is not to be defined, and no mortal or immortal has ever seen or comprehended it during the periods of Existence. The mutable cannot know the Immutable, nor can that which lives perceive Absolute Life.”– states The Secret Doctrine.
However, something prompts the One to create, to father. “Creation is shown as a sport, an amusement (Lila) of the creative god. The Zohar speaks of primordial worlds, which perished as soon as they came into existence.” “In the Hindu Puranas, Brahma, the creator, is seen recommencing de novo several creations after as many failures…”
And this relates to the universe, to the worlds and to our Earth. I also asked myself what makes God create. In one of the meditations I was given an image. God is like a child sitting on the shore of the ocean and building a sand castle. Over night the ocean destroys this creation, and in the morning he comes to the shore of the ocean again and builds his sand castle anew. Why does a child do it? Perhaps, God does it for the same reason.
So, at first a thought appears, a motive for the beginning of the creation. And this very thought itself already has a state opposite to the ABSOLUTE. In this very thought a duality is already contained.
“The esoteric meaning of the word Logos (speech or word, Verbum) is the rendering in objective expression, as in a photograph, of the concealed thought. The Logos is the mirror reflecting DIVINE MIND, and the Universe is the mirror of the Logos, though the latter is the esse of that Universe. As the Logos reflects all in the Universe of Pleroma, so man reflects in himself all that he sees and finds in his Universe, the Earth.”
“There was no ‘EVIL thought’ that originated the opposing Power, but simply THOUGHT per se; something which, being cogitative, and containing design and purpose, is therefore finite, and must thus find itself naturally in opposition to pure quiescence, the as natural state of absolute Spirituality and Perfection. It was simply the law of Evolution that asserted itself; the progress of mental unfolding, differentiated from spirit, involved and entangled already with matter, into which it is irresistibly drawn. Ideas, in their very nature and essence, as conceptions bearing relation to objects, whether true or imaginary, are opposed to absolute THOUGHT, that unknowable ALL…”
“ ‘Every Universe (world or planet) has its own Logos,’ says the doctrine. The Sun was always called by the Egyptians ‘the eye of Osiris,’ and was himself the Logos, the first-begotten, or light made manifest to the world, ‘which is the Mind and divine intellect of the Concealed.’ It is only by the sevenfold Ray of this light that we can become cognizant of the Logos through the Demiurge, regarding the latter as the creator of our planet and everything pertaining to it, and the former as the guiding Force of that ‘Creator’ – good and bad at the same time, the origin of good and the origin of evil. This ‘Creator’ is neither good nor bad per se, but its differentiated aspects in nature make it assume one or the other character.”
“…Logos manifesting itself as a double principle of Good and Evil.”
“To those who, prompted by old theological prejudice, may say: ‘But the Asuras are the rebel Devas, the opponents of the Gods – hence devils, and the spirits of Evil,’ it is answered: Esoteric philosophy admits neither good nor evil per se, as existing independently in nature. The cause for both is found, as regards the Kosmos, in the necessity of contraries or contrasts, and with respect to man, in his human nature, his ignorance and passions. There is no devil or the utterly depraved, as there are no Angels absolutely perfect, though there may be spirits of Light and of Darkness…”
“There is no Devil, no Evil, outside mankind to produce a Devil. Evil is a necessity in, and one of the supporters of the manifested universe. It is a necessity for progress and evolution, as night is necessary for the production of Day, and Death for that of Life – that man may live for ever.” 
“Perfection, to be fully such, must be born out of imperfection, the incorruptible must grow out of the corruptible, having the latter as its vehicle and basis and contrast. Absolute light is absolute darkness, and vice versa. In fact, there is neither light nor darkness in the realms of truth. Good and Evil are twins, the progeny of Space and Time, under the sway of Maya. Separate them, by cutting off one from the other, and they will both die. Neither exists per se, since each has to be generated and created out of the other, in order to come into being; both must be known and appreciated before becoming objects of perception, hence, in mortal mind, they must be divided.”
“The legend of the ‘Fallen Angels’ in its esoteric signification, contains the key to the manifold contradictions of human character; it points to the secret of man's self-consciousness; it is the angle-iron on which hinges his entire life-cycle; – the history of his evolution and growth.
“On a firm grasp of this doctrine depends the correct understanding of esoteric anthropogenesis. It gives a clue to the vexed question of the Origin of Evil; and shows how man himself is the separator of the ONE into various contrasted aspects.”
“Were it light alone, inactive and absolute, the human mind could not appreciate nor even realise it. Shadow is that which enables light to manifest itself, and gives it objective reality. Therefore, shadow is not evil, but is the necessary and indispensable corollary which completes Light or Good: it is its creator on Earth.
“According to the views of the Gnostics, these two principles are immutable Light and Shadow, Good and Evil being virtually one and having existed through all eternity, as they will ever continue to exist so long as there are manifested worlds.”
In the process of expanding the universe becomes denser and denser and, consequently, becomes more and more different from the natural state of the ABSOLUTE, and finally reaches the maximal point of materiality in which we are now. And if at the start the centrifugal forces predominated for the Spirit and centripetal forces for the Matter, then after the lower turning point the nature of these forces alters: “viz. matter will become centrifugal and spirit centripetal”. 
When man prevails his animal nature, when he allows the Spirit to hold sway over himself, he becomes a co-creator with God, and Spirit, residing within him, aspires insuperably toward its Source, and the worlds contract.
We return to the One, to that place where there is no Evil.
 The Secret Doctrine, Vol. 2 From here onwards the quotations from The Secret Doctrine (marked in bold italics) are taken from the edition: The Secret Doctrine by H.P. Blavatsky – Vol. 2 – THEOSOPHICAL UNIVERSITY PRESS ASCII EDITION (SCANNED AND EDITED FROM THE ORIGINAL EDITION OF 1888), p. 34
 The Secret Doctrine, Vol. 2, p. 53
 Ibid., p. 25
 The Secret Doctrine, Vol. 2, p. 490
 Ibid., p. 25
 Ibid., p. 214
 Ibid., p. 162
 Ibid., p. 389
 Ibid., p. 96
 Ibid., p. 274
 The Secret Doctrine, Vol. 2, p. 214
 Ibid., p. 261