The ending of Bridge to Terabithia is sad, but it's also beautiful. Leslie dies, and that's awful. She was Jess's best friend and, he felt, the best part of himself: "his other, more exciting self – his way to Terabithia and all the worlds beyond" (4.138). Leslie showed Jess that he could be more than he was, and that he could be great – that he should believe in himself and that he was worth believing in. Death's never not going to be hard to deal with or not make people sad. But when Leslie dies, that's the worst possible thing Jess could imagine. She brought Terabithia to life: it was always her speech that described who and what happened there, and Jess always turned to her for advice on how to act or speak in ways that "fit."
Partly, that's what makes the way he decides to honor her memory, and keep her with him, so moving. Instead of deserting Terabithia, or blaming it for Leslie's death – and Jess totally could have gone there – he realizes the value their shared imaginary land had and fights on to preserve it. By building the bridge to Terabithia and leading his little sister across it, he makes the magical land more accessible and reclaims it for himself. Just as Leslie taught him to use his imagination and look for secret worlds of mystery and magic where other folks only saw trees and brush, he's now going to teach May Belle about the value of such hidden things.