You might as well ask why we get dressed.
Framing dresses up your artwork and it helps set it off from your wall.
When you simply hang a painting up unframed, you, obviously, get to see the painting on your wall. The lines defining your painting, unframed, on your wall aren’t really clear that way. A frame “underlines” and defines your artwork’s place on the wall. It sets it off the wall and also adds flair to the piece.