Sheep are not the only animals with rectangular pupils, Goats, cattle, deer, llamas, and many other grazing animals have similar shaped pupils. They may look odd but they have a very important function.
These animals are generally considered prey animals and they have an evolutionary survival need to be alert for signs of danger at all times. These large rectangular pupils give the animals panoramic vision, allowing them to survey the horizon for potential threats.
As many of these animals live in open fields, it also helps the eye to gather more light from the ground and less from the dazzling sky. Conversely, predatory animals have slit-shaped pupils to help focus a target and judge how far away prey is, helping them to stalk and pounce.