Would it be useful to pint out that ToE does
not suggest that every extant trait exists
because it provides and advantage?
Some traits provide an advantage and are selected for,
other traits just exist, and get passed on with the
selected for ones.
If dreams are a 'necesary' part of brain function in humans,
there is no reason to assume that other animals don't
also dream. As someone else pointed out, I have seen dogs asleep
whimpering and twitching their feet, whilst having rapid eye
movements, and cats, and, to a lesser degree (and without much
human-audible noise or eye motions) my pet rats too.