Mob spawn does not respect lighting.
I have a 2-story tree house and both have enough lighting to not leave any corner in the dark but the mob spawn does not respect the lighting that I have since mobs appear as skeletons, creepers and zombies, so it does not respect the lighting where there is already light that you should avoid your spawn.