It's a combination of propaganda and easing the guilt of the soldiers. They wanted them to picture all of the german soldiers as bad guys. It helps to lessen the guilt the soldiers would have felt at killing them. It makes them more inhuman. By making them faceless Nazis, puppets of hitler and the nazi party, it made them easier to stomach killing. Just like it is easier to kill a person when you cannot see their face, if you cover it, and make it into something inhuman, it's easier to kill. Thats also why you hear a lot slurs and nick names used to refer to the enemy in most wars. Things like Japs, congs (I think that's the word), krauts, Jerry, etc. They make the soldiers from the other side into things, not people.
The other part of it is propaganda. On the home front of the war, they wanted to keep morale up, and remind the people that they were fighting monsters, not people. It made it easier for the people to feel good about what was going on in Europe and the pacific. it made them feel like heros in a way. Could you imagine how people would have reacted if you had stuck a picture of an 18 year old boy with his mother and father looking fondly at him, while he plays catch with his little brother, then said This is what we need your help to kill so we can kill Hitler. People would have been disgusted and felt horrible.
Unfortunately, it takes much longer for these ideas to be forgotten. They become so common that people have a hard time forgetting them even after the war has been fought and won.
My father is German, and his parents were raised in Germany during World War II. They were just two of the nameless, faceless germans that neither supported hitler, nor were openly against him. They just sort of floated through life during the war, admittedly they were young at the time.