Yes, lighting affects spider spawning. Spiders require a light level of 7 or less to spawn. Adequately lighting up all areas of the mob farm will prevent their spawning.