Theme
I would say the overall theme of this piece is the importance of doing the right thing, no matter what the cost. Rules are important. Without them we wouldn't be able to function, yet doing the right thing sometimes needs to be more important than rules.
In this book Harry has a knack for breaking rules. Sometimes it wasn't needed, and he was rightfully punished. However, there were times when he had to. Imagine this story if Harry and Ron hadn't broken a rule and saved Hermione, or if they hadn't gone into the restricted section of the library, or if they hadn't traveled to the forbidden area, and the list goes on and on.
Occasionally, a rebel is needed. Someone who will follow their gut, and do what they feel is best.