What I expected to happen was...:
No mobs would spawn if the player was in spectator mode as spectators do not interact with the world.
What actually happened was...:
Hostile mobs would not spawn on the surface as well as squids and fish in water, but sheep, pigs, cows, horses, and donkeys would spawn as normal on the surface.
Steps to Reproduce:
Go into spectator mode.
Fly or teleport away into new chunks.
observe the inconstant mob spawning.
This is because mobs spawn along with world generation. Probably intentional.