Humans, animals and birds all have two eyes. Why? In addition to why two instead of one, why aren't there more than two?
First, it's not true that all animals have two eyes. For example many spiders have four, six or eight eyes whilst worms have none, but all are animals.
In simple terms, the reason typical mammals have two eyes is probably similar to the reason that cars usually have four wheels, the reason houses keep out the rain and why coffee cups have handles. It's because that's what works.
Each time an organism develops, there is a high chance that the genetic information that built it will include something new. When that happens, most often the phenotype (essentially, the organism's appearance, such as how many eyes it has) does not change. The organism looks the same as its parent(s) did. If something significant does change, it is most likely to be bad news for the new organism. The chances are the organism will not survive and the particular genetic information that built it will not used again. Hence, organisms don't tend to be that different to their parent(s). Dogs don't give birth to cats.
But just rarely, this new combination produces something different and useful - useful enough that the organism is particularly successful and a good fit for its environment. In that case, simply because it can, the organism has more offspring and more of those offspring themselves survive to have offspring of their own. The genetic information that built the organism is thus used to create more, similar organisms.
So, the first eyes were produced by accident. When eyes turned out to be useful, subsequent generations from the first organism with eyes were more likely to have eyes themselves. As it turns out, analysis of genomes shows that eyes have evolved like this multiple times.
We can only assume that since mammals typically have two eyes, either the random genetic accident that would produce different numbers of eyes in mammals has never happened, or if it did happen, the result was not a good fit to the environment.
Why not no eyes? Human beings are occasionally born without eyes and the cause may be genetically inherited. One might reasonably imagine that for much of human history such a child would be unlikely to survive into adulthood and thus pass on this mutation.
Why not one eye? One reason in the case of primates is that two eyes are useful for estimating distance, which is difficult with one eye. A two-eyed animal has an advantage against predators, making it more likely the next generation is going to have two eyes.
Why not more than two eyes? Perhaps a larger number of eyes requires a larger head making childbirth impossible, or perhaps it requires too much energy to sustain. Who knows? What we observe today - humans typically have two eyes - means that, if that mutation for more than two eyes did happen at some stage, then more than two eyes wasn't optimal for the environment in which the resulting organism found itself, so it didn't get passed on to the next generation.