One of the ways in which the Harry Potter novels, although traditional in their deep structure, were representative of the modern world, is that the goodies were not 'cool'.
In the modern world, pretty much everybody who is 'popular', cool, beautiful, smart, witty, successful, admired and fun is a baddie: that is, a servant of evil.
And the people on the right side are by comparison square, dumb, plain, lame, nuts, nerdy and boring.
Harry's school gang is a bunch of 'losers' that includes a swotty 'mudblood', a seedy and impoverished blood traitor, the clumsiest and least-talented kid in the school, and a loony.
(Admittedly, on the periphery there are also a beautiful redhead and some anarchical trickster twins.)
The lesson is a Christian one, as also seen in Narnia and Lord of the Rings - if Good is to prevail over evil (eventually) it will only be by love, courage and self-sacrifice - and the assistance of divine providence.
In the modern world, Good will never win due to its superior power - or because people on-the-side-of-Good (remembering there are no 'good people') are more cool and popular - the servants of Good are a bunch of despised losers who can only win with the intervention of divine providence - covertly apparent in the form of 'luck'.
But as chance favours the prepared mind, good fortune will favour only a loving heart.