Although our focus tends to be on the protagonist of a book, the truth is that secondary characters often tell you a lot about the main character. This can come out in conversations and various situations or in the rare chapter where we see the story through a secondary character's eyes. This is important because it allows you to get to know that character much better and connect with them on a deeper level. It's like when you meet someone; the more they reveal about themselves, the more you feel a bond or at least an understanding of their personality and values.
Why is that important? Think about it in terms of real life. Suppose you meet someone online. That person will show you the images that flatter them, tell you stories that make them sound interesting and tell you how they see themselves. When you meet them in person, you'll notice different aspects of their personality. This could be good or bad, but the point is that you see a fuller picture in person. If you then throw another person into the mix, say one of their friends or a family member, you'll once again see them more clearly just through their conversations, body language, and the general vibe you get when they are together. This is how we learn about people. Characters are similar in that we learn more about them through their interaction with other characters.
One great example from the Hernandez series is how Chase Jacobs changes throughout the series. In the first book, We're All Animals, Chase is very much the boy next door, probably a little naive especially compared to other characters in the book. Jorge recognizes this aspect, but on the flip side, Chase shows us how Jorge is intimidating, strong, and dangerous. However, if you only heard the story from Jorge's viewpoint, you'd probably be left thinking that he's justified in many of his actions because that's the story he wants to tell you.
I find it a little unsettling when I read a book that focuses only on the protagonist and where they are coming from because I don't feel like I'm hearing all sides of the story. In turn, it sometimes hides the main character's flaws, which isn't realistic and tends to paint the picture of a saint who's the victim. Real-life and realistic characters are much more complex.