As noted by thanatassa, Bluntschli uses the return of the coat as an excuse to visit Raina. This, along with the discovery of the photograph, helps ensure that our lovers will eventually marry. But we can also answer this question in terms of the more immediate effects -- on the action, the characters, and the audience's experience. Shaw uses the coat to put Catherine's plans in jeopardy, pit her against her unwitting husband, and create farce.
The "coat episode" might refer to a couple of scenes. The first happens at the end of Act II, when Bluntschli tells Catherine he is returning the coat, and Catherine tries to keep the exchange a secret. She doesn't want Petkoff and Sergius to learn that Raina had loaned the coat to Bluntschli.
The second happens in Act III, when Petkoff complains that he can't find his old coat, and Catherine insists that it is in the blue closet. Once again, Catherine is trying to conceal the fact that Raina gave the coat to Bluntschli. She wants Raina to marry Sergius and believes that Sergius will call off the engagement if he discovers the truth.
In both cases, the coat serves an important dramatic purpose. The loan is evidence that Raina sheltered Bluntschli and showed sympathy for him -- facts that Catherine regards as embarrassing and scandalous. Thus, the coat becomes the focus of conflict, tension, dramatic irony, and farce.
Conflict: Left to their own devices, Bluntschli and Petkoff would have acted in ways that resulted in Petkoff getting the coat promptly. But Catherine wants to return the coat in a way that doesn't arouse suspicions, so she is preventing this direct transfer.
Dramatic tension: Because we understand what Catherine believes is at stake, we feel tension. We're put on the edge of our seats. Will Raina's past actions be exposed?
Dramatic irony: The audience knows key facts about the coat -- and Bluntschli's previous visit -- that Petkoff and Sergius don't know. This creates dramatic irony, increasing our anticipation of what might happen next.
Farce: All of this conflict, tension, and dramatic irony is played for comic effect.