In answer to your question, first consider these observations. One of the primary themes in the novel is based on Fitzgerald's assessment of American society in the 1920s. He develops stark contrasts among the social classes in the East and between the values of Eastern society and those of the Midwest. Nick Carraway as narrator represents Fitzgerald's voice and views.
When he first arrives in New York and gets caught up in the Buchanans' lavish lifestyle and the trappings of Gatsby's enormous wealth, Nick is swept away with the glamour and the excess. By the time the novel ends, however, Nick has come to feel complete moral revulsion by what he has observed and experienced through his association with the Buchanans. He turns his back on life in the East and goes home to the Midwest. He seeks some kind of moral behavior in society. Through Nick, Fitzgerald's theme is realized: Beneath the staggering wealth, glittering beauty, and romantic glamour of American life in the Roaring Twenties lay a dark moral corruption and insidious social decay.
The presence of violence in the novel plays an essential role in the story and emphasizes this theme. As Wolfsheim's associate, Gatsby's wealth and all the beauty it could buy resulted from gangsterism and ugly violence. Tom Buchanan was viewed as a gentleman in society, one whose great wealth gave him polish and respectability. Beneath that thin veneer, however, Tom was cruel and violent, a man who would hit a woman in the face without hesitation. He also directed a distraught George Wilson to Gatsby's house, knowing full well the likely consequence. Gatsby's murder and George's suicide were acts of shocking violence that contrast with great irony the beautiful, lush surroundings in which they occur.
The violence in the novel does far more than help the story; the story is dependent upon it in developing character, plot, and theme. It emphasizes the corruption of the American Dream as Fitzgerald found it in the 1920s.