How does character and setting help Huck with moral growth and development?
Well, Huck character changes as he escapes his father and pretends to be dead by running away. On the way, he meets up with Jim, an escaped slave, whom Huck has known for awhile. Getting to know Jim by eating, working and sleeping in close proximity, Huck learns that black people are basically the same as white people: they eat, sleep, feel, think, love, hurt, and want freedom for themselves and their families.
Huck, being reared in the south, has known no other way than for blacks to be slaves and whites to own them. Now, after having established a true friendship with one, his attitudes and opinions have changed. Jim is a plain man, but he is sensitive and caring, and treats and loves Huck as if Huck were his own boy. He genuinely thanks Huck for his friendship and his help, and Huck, consequently, decides that if helping this man whom Huck admires to escape will land him in Hell, then he'll just go to Hell.
The setting--that of the confined space of the raft and the open space of nature and the south--is the only place this kind of friendship could blossom. On the river and the raft, Huck and Jim have ample time to talk and get to know one another. There is no other work or duties to perform which would call the two of them away from each other. Only this setting would allow for such a deep and close relationship and bond to form. Jim teaches Huck like no one else after the fog incident, as well.