I personally find goat eyes disturbing with their horizontal pupils it reminds me of the devil. Crocodiles and cats for example have vertically shaped pupils that also make them look evil. Why? Not why are they evil, but why the non-circular pupils? Despite being evil humans have circular pupils so they must be the best.
It turns out that these pupils evolved to make use of a multifocal lens. Basically the lens of the eye in these animals has different refractive indexes at different distances from the center. This has evolved to enable sharper images focused on the retina. Because different wavelengths of light will be refracted differently the lens has different refractive indexes to focus different colours in the appropriate place on the retina. So to take advantage of this system in bright light the animals still need the outer section of the lens for whatever colour that section focuses. Okay so my explanation and understanding aren't perfect so here is a pretty good article on the subject of multifocal lenses and pupil shape if you want to get a better idea.
But why horizontal and vertical shaped pupils? The only source I was able to find was a forum post that cited some work from 1907, that apparently showed that the ability of humans to distinguish discrete points with and without an artificial slit-form pupil was increased with a slit-form pupil perpendicular to the plane in which the objects were located.
So predators like cats and crocs who hunt on the horizontal plane have acquired vertically shaped pupils. While goats and sheep who navigate some steep mountainous terrain need horizonally shpaed pupils. (I guess?)