Eyewitness testimony is not infallible because people are not infallible.
There are any number of factors that contribute to the fallibility of eyewitness testimony. The eyewitness can be mistaken in identifying a suspect because he or she did not get as good a look at the perpetrator or the crime as he or she initially believed. Viewing a crime, especially a violent crime, from close up as it occurs is by definition out of the ordinary for most people and highly stressful. Under those conditions, people make errors in judgement and occasionally claim to have witnessed more than subsequent reflection indicates was actually the case.
Another factor that makes eyewitness testimony prone to error is personal prejudices that the witness may harbor. For example, a person accustomed to reading about crimes perpetrated by a certain category of people, usually involving ethnicity or race, may be predisposed to recall the event in question through the prism of those prejudices. Similarly, and defense attorneys and prosecutors alike will take this into account, victims of crimes who later witness a similar crime may be motivated by revenge in their "memory" of what transpired. Justice may have eluded them, but they won't let a "criminal" get away with it this time.
Eyewitness testimony usually needs to be corraborated by physical evidence, for example, fingerprints or DNA samples.