It reinforces the casual way these criminals deal with death. It's not a major event in their lives, but part of the lifestyle they've grown into. This combines with their near death minutes earlier, leading Jules to his decision at the restaurant.
And the color of Marvin's skin has nothing to do with these events. It's not any sort of comment on race. It's the wild part of the Bonnie Situation story.
How do you feel about what happens to Marsellus Wallace in the basement?
All it does is reinforce the fact that these characters are bad people which isn't needed to be further restated after the first two stories.
Then maybe that's not all it does. I thought it showed that - like with any profession - there are pros and there are idiots. Travolta's character is an idiot, especially when it comes to be careless with loaded weapons, which is why he ends up on the bad end of Bruce Willis.