Not everyone has a perfect memory, and people who remember faces but almost always forget names often actually have high-IQ traits that explain their brain process.
Some people are good at remembering names and understand how important that acknowledgement is. It makes people feel important and lets them know you are paying attention and that "nice to meet you" ...