I'm of the impression that they have the same spawn rules as the rest of the hostile mobs. IE: the place has to be sufficiently dark... and that's about it. (they obvoiusly would have to 'fit' where the game places them as well)
The reason behind the question is I almost always (say 80% of the time) have spiders spawning along the outside of the east wall of my house, and there seems to be no reason or rhyme to it beyond that. Its ALWAYS spiders, the house is equally lit along all sides on the outside and in. I am unable to provide screenshots unfortunately, but to help give you an idea of the terrain, my house is surrounded by a 2 block deep and 2 block wide trench, with a one block wide 'balcony' directly outside my wall. the trench is surrounded by a fence. I'm stumped. The east exterior is exactly the same as the west exterior. there should be no reason for this.
I'm aware that supposedly spiders could spawn outside my territory and 'hop' over the fence and get in, but why always the east side? I have no problems anywhere else. And why is it only spiders? If it was somehow a lighting issue I should be getting mobs of all kinds shouldn't I?