In The Giver, memories are a source of wisdom, but also of pain. We learn that the latter is the cost of the former. We learn from mistakes, and without the memory of those mistakes, we cannot actively make decisions about the future. The novel also argues that memories are meant to be shared; there is a value in the collective knowledge of a generation, and in the way that knowledge is passed on to others. Without the sharing of memories, the memories themselves are of no use.
Jonas does his community a service by leaving and releasing the memories to the public.
Jonas's decision to abandon his community is selfish.