Why did Mrs. Luella Bates Washington Jones shut the door quickly?
In the final paragraph of "Thank You, Ma'am" Roger has just been ushered to the doorway of Luella's home. The description of his departure indicates that Roger wanted to say more than he was actually able to before the door was closed between him and Luella. The text does not actually say that the door closed "quickly", as you described it in your question, but it is implied that its closing happened sooner than Roger was ready for it to close. At any rate, the purpose of Luella closing the door before Roger had finished thanking her may be interpreted in multiple ways.
First of all, if we recall the moments right before this scene, Luella had just told Roger that she needed to get her rest. She is a woman who sets firm boundaries, and if she really needed to go to bed at that point, then her abrupt shutting of the door makes sense. She does not seem like the sort of person who would waste time in a lingering goodbye after already saying everything she needed to say.
Another interpretation might be that Roger took too long to muster up the courage to speak, and she simply stopped waiting for the words to come out. When the story began, it was already 11:00 at night. By the time their dinner and conversation have ended, it is probably midnight or later. Luella may not have even realized that Roger had begun to speak if she was already in the middle of closing the door by the time he felt able to say anything.
Alternatively, maybe she did realize he was about to thank her and shut the door on him on purpose. Maybe she was actively trying to avoid hearing his thanks for some reason. Could it be that she would have felt embarrassed by the gratitude? Or maybe being thanked would have made her feel like her good deed was more of a transaction rather than something that was simply the right thing to do. Leaving Roger on the front porch with nobody to hear his thanks puts him in the position of having to process what just happened all by himself. And with nobody in front of him to say thanks to, maybe Roger will look for other ways in life to express the gratitude Luella's act of grace has given him.