Let’s face it, as good as JK is, Peeves just isn’t that funny. If he had been in the movies, he might have stirred up a Jar Jar level of hatred, though that’s a tall order. So why include him in the books? On the surface it seems like comic relief, but all the scenes with Peeves essentially recycle the same jokes over and over and over and over for seven books.
He occasionally serves a plot purpose in a scene, to cause a needed distraction away from Harry’s wrongdoings, or frequently to make a bad situation worse. However, his antics serve a deeper purpose as well. While Filch laments that he wishes Dumbledore would get rid of Peeves, kick him out of the castle, Peeves remains. Even though Dumbledore seems to have the ability to, he chooses to allow a source of chaos to remain. Why?
Peeves presence at Hogwarts creates a sharp contrast between Harry’s life at school and his life with the Dursleys. His aunt and uncle do not tolerate anything unusual or unexpected. During his first evening at Hogwarts, Peeves throws walking sticks at a group of first years. Harry learns quickly that Hogwarts is a place where freedom and even a little chaos are considered normal.
Dumbledore shows a deep commitment to freedom throughout the books. He allows teachers a shocking amount of latitude in teaching their subjects. Moody and his unbreakable curses. Hagrid, who didn’t even finish middle school teaching what he’s passionate about. Also, Snape. Just Snape. Can you imagine your local public school letting that man around children? He’s petty and spiteful, bordering on abusive.
Dumbledore gives Harry just enough freedom to step up to a challenge that many adults would not take on. Who would give an eleven-year old an invisibility cloak? That cloak gave Harry, Ron, and Hermione freedom. Freedom that they could use well or abuse for selfish gain. They could have just caused trouble instead of trying to get rid of the Philosopher’s Stone.
They did use it to break rules, which surely Dumbledore knew would happen. He’s been at Hogwarts too long to have kept any delusion that the students don’t get out of bed at night. Or you know, set fire to their curtains in their third year. But he gave them that freedom nonetheless.
Harry did made mistakes with his freedom. He became obsessed with the Mirror of Erised. Dumbledore guided him, but never laid down the law or even reprimanded him for being out of bed after hours. He continued to give Harry freedom, even in his mistakes.
Dumbledore knows that when people have freedom, they have the opportunity to flourish, and he makes sacrifices to ensure those opportunities. Freedom also provides opportunities to fail miserably. So with freedom comes a bit of chaos. Sometimes it’s mediocrely funny chaos on repeat, but it’s a good trade.