"Pretty obvious" answers never hold up much to scrutiny, or the questions wouldn't be actively studied.
Many animals are nocturnal. They eat and mate during the night, and sleep during the day. From your theory, what reason do they have to sleep during the day? They could be doing all sorts of productive things in the light -- more mating, making homes, defending themselves and their babies from predators, migrating, etc etc.
It looks like some pretty heavy optimizations are needed if you want to be successful in one of those environments (daytime vs nighttime). Visual perception has to be fine-tuned for one of those environments. Perhaps thermal regulation is different too.
So I guess one possible explanation is that too many fine-tunings are required to work well in one environment, to allow the organism to be a good performer in both. So the logical choice is to withdraw from the other environment - just don't participate.
The parent comment only mentioned humans being diurnal, not other animals.
There's a number of strong evolutionary forces that explain nocturnality: niche differentiation, crypsis, a predation arms-race, water conservation, etc.
Many animals are nocturnal. They eat and mate during the night, and sleep during the day. From your theory, what reason do they have to sleep during the day? They could be doing all sorts of productive things in the light -- more mating, making homes, defending themselves and their babies from predators, migrating, etc etc.
Yet they need to sleep during the day. Why?