Literally speaking, the role of the soap is that it fools Norman Gortsby and makes him give money to the young man.
The young man says that he has forgotten which hotel he was staying in (he had just checked in, he says, and gone to buy some soap for himself). He says he needs money to tide himself over until the next day.
The young man can't produce any soap, though, so Gortsby disbelieves him. Then Gortsby finds a bar of soap on the ground and goes to find the young man. After he gives him money, he finds out the soap actually belonged to an old man who had sat at the park bench with Gortsby before the young man came.
Symbolically, I think that the soap represents fate and luck. It was just lucky for the young man and unlucky for Gortsby that the soap happened to be there.