I always assumed that those fantasy light/dark associations came from much older (as in, pre-language and pre-sentience) human feelings of "day/light/warm/safe/good/life" and "dark/night/cold/fear/bad/death".
I'd agree, it seems like an almost primal comparison, rather than something deliberately conceived. The way some places in the books are described take that quite literally: Rivendell, the bastion of good, is described in terms of safety and light (even at night, with the moonlight), and Mordor, the bastion of evil, is described in terms of danger and darkness.