No one knows what purposes, if any, dreams serve, although there are a number of hypotheses.
Hypothesis
Dreams are produced when the brain is erasing "parasitic connections" (accidental associations between ideas) that build up during the day and would otherwise clog up our memories.
For an animal that doesn't dream to have an effective memory, it would need a big brain in order to accommodate all the accumulating clutter.
Goal
Let's find an answer that aligns with any of the hypothesis's ideas.
Maybe data points showing the brain is slightly smaller after dreaming than it was before.
Maybe an animal that doesn't dream and doesn't have a big brain, and thus has an ineffective memory.