Harry Potter, like Lord of the Rings, does not deserve its popularity. Here's why.
The biggest problem by far with Harry Potter is the portrayal of authority. The ministry of magic, as well as every authority at Hogwarts, is horrifyingly evil and portraying them as merely overzealous or somewhat corrupt but still legitimate is like portraying Nazis as nothing more than jerks. Just think about some of the things the ministry's done.
None of the ministry's authority is legitimate in the first place. It's like a typical democracy that no one consented to, except most individual wizards don't even get a vote.
The rule against underage magic outside of school is absolutely iniquitous. If I were a parent, I'd want to unlock my children's powers as soon as possible so that they could use them for good. Thus I would buy them wands and teach them magic as soon as they were old enough to understand and control it. But the ministry of magic would have me thrown in jail for it without even caring whether I and my children were using our magic for good or evil.
They use imprisonment as a punishment.
Some of the things they use that punishment for aren't even close to inherently wrong. Any of the "unforgivable curses", one of which simply kills a person, another of which takes control of someone's body, and the last of which causes extreme pain. Clearly all three of these can be used for good, especially the first one.
The rule against telling muggles about magic. I'll talk about the logical absurdity of this below, but it's a moral thing too, because when you ask someone to keep a secret from a close friend, you ask them to do something evil. When you threaten someone with expulsion or imprisonment to keep a secret from a close friend, you do something far more evil.
Now for some of the hogwarts-specific injustices.
The rule against being up after hours is a form of imprisonment. There's no justification for it; it's not even like there's some danger in the castle at night. It's just pointless oppression. Also, the night sky is one of the most beautiful things in the world and seeing it is extremely wholesome for the human spirit (I'm planning to write a separate article on this). Any authority that says we can't go out and admire it should be taken down.
That students are grouped into houses, and honored based on the collective merits of their house. This, of course, equates to rampants amounts of both punishing the innocent and rewarding the guilty. Like the other injustices here, there isn't any positive argument for it.
In conclusion, every authority figure in the series - even Dumbledore - is extremely evil, and the story should've focused on Harry starting a rebellion against both Hogwarts and the ministry.
A seven-book series about students at a magic academy was the worst possible story in which to put the epitome of an obfuscated magic system. I detail this objection in my article on magic systems, although if you've read any criticism of Harry Potter on the internet you probably know the drill already.
A subpoint: Rowling claims that horcruxes "split your soul into pieces"; what the hell is that even supposed to mean?
Why the fuck is the wizarding world a secret? It must be a lot of trouble to keep it that way. Sure, you could make the argument that the world's muggle governments would be afraid of magic and try to exterminate it, but seriously, how are they going to do that? The wizards can enchant their castles so that they're invisible to muggles, they can unleash dragons on their enemies, they can use the imperius curse to just take control of any government and military leaders that oppose them, and most importantly, they can roll back time as much as they want. What do the wizards have to fear?
Quidditch is the worst feat of game design I've ever seen. It's a game of soccer going parallel with a game of tag, and the only way to make the outcome of the soccer half even affect the outcome of the game is to get a whopping fifteen points above the opposing team before somebody can catch a flying ball. So basically it's a fourteen-player game where 90% of the time the outcome is determined by just two of them. Rowling also never explains what makes it take longer or shorter to catch the snitch. Some games, it's stated in the book, go on for three months, while most of them end in a few minutes. So if there's no difference in the snitch, what gives?
There's time travel in it. This is an instant disqualifier.
It's riddled with plotholes. Now it's been years since I've read the books (and longer since I've seen the movies) so I can't remember enough to defend this point much, but even my brother, a hardcore fan who has read them several times, admits that it is so.
The writing is just terrible. Aside from being severely over-descriptive, Rowling has no idea how to handle dialog tags and frequently uses "10-year-old me"-level descriptions of emotions that combine "telling over showing" with cliched metaphors (case in point: Snape just took fifty points from Gryffindor for the lulz and she writes that "Harry's anger boiled white-hot".)
Why not instead write: "Harry's teeth clenched. He wanted to punch Snape in the face so badly right then. He was so sick of being treated like this and not being able to fight back. But wisdom got the better of him, and he didn't let Snape see his anger."