Thus as soon as the Tzimtzum came about, it brought into existence this power to cause deficiencies, which would eventually produce evil. Indeed, this power was central in all the acts that followed the Tzimtzum, standing ready to descend and spread forth from level to level until actual evil emerged. However, since the intention was not only to produce evil, it did not immediately bring forth the evil that is the opposite of perfection. In fact, the intention was to produce good and evil together. For this is the difference between perfection and imperfection: perfection is entirely good, while imperfection can include good and evil. Perfection consists of nothing but perfection, while that which is deficient may involve many deficiencies, each one worse than the other.
How the Origin of Evil Links to Creation Itself
Kalach Pitchei Chokhmah 30:37