Man, Ernie's the guy you sorta forget about until a re-read, then he's suddenly everywhere. Like, he starts off as this loud Hufflepuff prefect who's all 'I support Harry Potter' during the Chamber of Secrets panic, then immediately backpedals when everyone thinks Harry's the Heir. Shows he's not some unwavering pillar, he's just a kid who really, really cares about status and doing the 'right' thing according to the official story. But that's what makes him interesting later.
He's the embodiment of a certain type of well-meaning authority. Always eager to be part of the system, to enforce rules, to be seen as responsible. But his arc is learning that the system can be rotten. By the fifth year, he's in Dumbledore's Army, which is a huge shift for someone who probably dreamed of being Head Boy. He's still a bit pompous—the whole 'I am a Macmillan, of pure-blood stock' thing—but he fights. He's at the Battle of Hogwarts. That contrast between his natural, almost comical stuffiness and his underlying courage is his whole deal. He's the kid who'd write the rulebook, then tear it up when it mattered.
I always picture him years later, a perfectly respectable Ministry official, but one who secretly helped smuggle Muggle-borns during a crisis, because he learned the hard way where real loyalty lies.