The only reason I can think of is that it's better for people to have such attacks of anxiety at night, than during the daytime when they are up-and-about and interacting with other people! Anxieties have to work themselves out at some point...better when you are alone and no one else can see you or perceive what you might be thinking & feeling...! At night we can just curl up in a ball and focus on the worst, even if it causes us to tremble or cry... we certainly can't do that at the office, with our peers looking on. The "dark" topics that nightmares consist of have to be worked out mentally at some point-- keeping them bottled up inside indefinitely would cause everyone to go mad.