The significance of Scout having lunch with Walter Cunningham is twofold.
First, Scout begins to learn that she cannot beat people up who aggravate her. In this sense, we can say that Scout is learning to grow up, which is an important theme in the book.
Second and more importantly, Scout's friendship with Walter will play a vital role later in the book when Walter's father and other men come to the jail to harm or even kill Tom Robinson. Here is the context.
Before the trial of Tom Robinson, the county puts Tom into a prison. When some men hear about this, they go out to harm him. Atticus has an inkling that something might happen. So, he goes out to make sure that Tom will be fine. This is when a mob comes. They even threaten Atticus. Atticus, as a man of courage does not back down.
At this very moment Scout comes and recognizes Mr. Cunningham. She even starts a conversation with him. She says that she goes to school with his son. When she says this, Mr. Cunningham comes to his senses and tells the mob to break up. Had Scout not been there and not had a relationship with Walter, Atticus and Tom could have both been killed.
Here is a short snippet of Scout's dialogue:
“I go to school with Walter,” I began again. “He’s your boy, ain’t he? Ain’t he, sir?"
Mr. Cunningham was moved to a faint nod. He did know me, after all.
“He’s in my grade,” I said, “and he does right well. He’s a good boy,” I added, “a real nice boy. We brought him home for dinner one time. Maybe he told you about me, I beat him up one time but he was real nice about it. Tell him hey for me, won’t you?”