Hmmm...I don't know. Interesting. A surname can add a new dimension to a main character like suggest an ethnicity, and that's good. It can also make a main character seem more developed and realistic in certain genres like mysteries, mainstream fiction, romance, some science fiction, young adult, and anything set in a world like ours. But it might not apply for fantasy or historical fiction.
As for walk-on characters, maybe not. You might be telling the story in the deep third-person viewpoint of your main character and he'd have no way to know, or no need to find out, the surname of everyone with whom he has a brief encounter. He might not even know their first name, and just be thinking of them by a handy nickname. Stephen King does this a lot... T-Shirt Guy, Big Purse Lady, etc.