This event is important to the play because it hints to us that there is no possible way that there will be a happy ending.Too much was lost in this scene (the two deaths), so it would be highly unrealistic if somehow in the end, Romeo and Juliet's famillies will magically come to a truce and end their grudges. This event just made it so that more tensions came between the two famillies.
Romeo's banishment also reinforces the that there will be no happy ending, as he is not able to ever return to Verona. This also plays a role in the tragedy of the play, because he won't be able to see Juliet again, and he doesn't know it, but the next time he sees her, will be the time of his own death. And in the case he was killed and not banished, Juliet would've been left alone, not making it as much of a tragedy