Why does Charlotte go to all this trouble for "some pig?" Because he's her friend, and that's all the reason she needs. Or to quote the book...
Wilbur: Why did you do all this for me? I don't deserve it. I've never done anything for you.
Charlotte: You have been my friend. That in itself is a tremendous thing.
Fern's song to Wilbur in the animated film, "There Must Be Something More".
Along with that, the montage showing Fern raising Wilbur.
Charlotte's lullabies to Wilbur.
Charlotte's last moments with Wilbur
In a cross between Heartwarming and Tear Jerker, the 1973 adaptation shows a montage of Wilbur and Charlotte's time together as she sings her final song in the last moments of her life.
Blink and you'll miss it: In the 1973 adaptation, Henry Fussy gets back to town from visiting his grandpa just in time for the fair. He takes Fern on the Ferris Wheel, and when the height frightens her, Henry puts his arm around her. In response, Fern moves closer and gives him a very sweet look.
Live Action Film Examples
Specifically, this dialogue from the live action version that crosses both tearjerker and heartwarming:
Wilbur: Please, Charlotte! You have to come down! You've done so much for me! Please! There must be something' I can do!
Charlotte: No, Wilbur. Don't you know what you've already done? You made me your friend. And in doing so, you made a spider beautiful to everyone in that barn.
Wilbur: I-I didn't do anything, Charlotte. Y-You did it all.
Charlotte: No. My webs were no miracle, Wilbur. I was only describing what I saw. The miracle...is you.
In the live action film, the way Charlotte lands on Wilbur's snout is very...sweet. Just something heartwarming that deserves mention.
The barn animals take turns keeping Charlotte's egg sac warm throughout the winter. Even Templeton.
Animated Sequel Examples
In the 2003 DTV sequel, we have Wilbur's friendship with Cardigan, a black lamb neglected by his own kind. Wilbur was one of the few animals on Zuckerman's farm to befriend him, knowing full well what it's like to be the runt of the litter (or in Cardigan's case, the Black Sheep) and to be denied the company of others.