Why did Opabinia have 5 eyes?
Short answer
The number of eyes are not always even-numbered. In fact, many present-day lower vertebrates feature an uneven number of eyes.

Background
Eyes can be generally defined as photosensitive organs. Besides the regular paired eyes, lower vertebrates such as fish, amphibians and reptiles feature an unpaired (single) brain structure called the pineal gland, or parietal eye. It is primarily a photoreceptor organ, and its electrical activity changes in response to environmental lighting (Fig. 1). The pineal does not mediate vision, and it is mainly involved in regulation of circadian rhythms (Deguchi, 1981).

Hence, many lower vertebrates can be considered to have 3 eyes. In fact, the blind cavefish Astyanax mexicanus undergoes bilateral eye degeneration during embryonic development. Despite the absence of light in the cave environment, cavefish have retained a structurally intact pineal eye. Hence, cavefish can be said to have a single eye (Yoshizawa &amp; Jeffery, 2008).


Fig. 1. Reptilian parietal eye. Source: review of the Universe.

The mammalian pineal gland is a secretory organ only, and no longer responds to direct illumination. In mammals it is situated deep in the brain and the mammalian skull does not admit light into the brain. Instead, the mammalian pineal needs input from the eyes to regulate the circadian rhythm.

References
- Deguchi, Nature (1981); 290(5808):706-7
- Yoshizawa &amp; Jeffery, J Exp Biol; 211:292-9