In Egyptian myths about the origin of the cosmos everything began in a dark cosmic sea. Similarly, in the Babylonian myth Enuma Elish there was nothing but water to start with. Everything came out of that.
Genesis 1 is the same. Everything starts with a dark and watery primeval state. Creation involves God organizing the waters and putting them in place so that life can flourish.
God says "Light be" but he does not say "darkness be."
God divides the waters into the waters above (kept at bay by a solid sky dome) and from the waters below (the seas), and the seas from the land. In this way God creates the sky, the sea, and the land as distinct zones. God organizes creation by moving water around; however, God does not create water.
This suspicion is reinforced by the way in which most OT scholars (though not all) translate the opening of Genesis: Something like this—"In the beginning of God's creating the heavens and the earth, the earth was formless and empty, darkness was over the surface of the deep . . ." In other words, creatio ex nihilo has many theological merits (and I am not suggesting that the church abandon it) but it is very likely that Genesis 1 does not teach it. The interests of Genesis lie elsewhere.
So it seems that in Genesis 1 (and that's all I'm talking about here) darkness and water are not so much brought into existence as contained and funneled to serve divine purposes. They are not evil but they are only declared "good" by God when they have been constrained and given a functional role in the cosmos.
So there, woven into the very fabric of the good created order, are the remnants of primeval darkness and chaotic seas—under divine control but dangerous none the less (as Noah's flood shows).
It would be interesting to do a wee bit of theological reflection on this.