There's plenty of suffering in David Copperfield, from David's abuse at the hands of Mr. Murdstone to Doctor Strong's sorrow at the thought that his young wife is cheating on him. Suffering affects the characters in the novel (as it does in life) in a variety of ways: Mrs. Gummidge rises to the occasion, using the suffering of those around her as an invitation to help. Mrs. Copperfield crumples under the weight of her suffering, slowly wasting away and dying. But one thing is certain in nearly all of these characters: suffering profoundly alters and changes each of them. Indeed, suffering may be the primary tool of characterization in David Copperfield. After all, it's thanks to his humiliation in charity schools that Uriah Heep becomes such a jerk. And it's David's childhood poverty that makes him so sympathetic to poorer people like the Peggottys (unlike Steerforth). Suffering is something all the characters in the novel encounter. The measure of each character is how he responds to it – a moral lesson we can get behind!
By showing a contrast between David and Uriah Heep's characters, Dickens creates a model for moral behavior based on compassion and sympathy for the suffering of others.
Happy marriage is what finally shelters David and Traddles from suffering; characters like Steerforth and Uriah Heep suffer because they cannot successfully establish their own families.