The reason why the mind is like this is because, in order to sleep, we must give ourselves into drowsiness. Those with untrained minds (if not everyone) thus plunge themselves into delusion. That's why in dreams, everything's all loopy and oftentimes you don't realize that you're dreaming. When you wake up, your mind is just emerging from that state.
I think what happens with most is that they get worked up over the drowsiness they experience when they wake up, so they assume their mind has gone down the rabbit hole. But it hasn't, unless you're getting worked up about the drowsiness! It's simply another experience of the aggregates.
So when I wake up, what I do is remember the conditioned nature of experience in terms of the aggregates, particularly the part which deals with contact and the sense-bases. Whatever you see is an eye-object accompanied by feeling, perception, and volition. The same applies to the other sense bases. This gets my mind back in the grove because our practice involves great use of the 6-sense bases, until you get to the formless states of samatha meditation. How could you investigate the elements without the sense bases? What is their to develop dispassion towards if it isn't the senses?
In your waking life, using the aggregates as your work station, investigate drowsiness so you can understand it more and not become worried because of it. There's the feeling in the body, the passion towards the feeling (a volitional formation which manifests as laziness and leads us to taking a nice, comfy rest on our bed... or desk)... just try to understand it more.
I hope this solves your problem.