Electro also works to distinguish peters actions as spider-man and the consequences of those actions, to reiterate that he cannot save everyone and even when he can do something, sometimes it just isn't enough. This is in contrast to Harry, where the omission of action led to Harrys descent into evil.
From a film perspective, Electro worked as a visual treat, and a road to connect harry, peter and gwen through outside means.
Overall, electro's story is that of loneliness, of insanity, and ultimately, of a power struggle, quite literaly in every sense of the word by the end of the film.
He exploded
But Electro's connection to Peter, Harry, and Gwen is tenuous at best. Peter only met Max for like thirty seconds before their Times Square encounter, Harry only knew him for a few hours, and Gwen merely talked to him once in an elevator. He has almost no relationship with the characters. Even Spider-Man only has two brief clashes with him because he gets shoved into a prison, minimizing his presence and overall use in the movie.
I do agree that Electro and Harry are opposites in that they are created by different circumstances - Peter failing to save Electro and Peter choosing not to help Harry for the time being.
However, any villain could've been in Electro's position if the writer's wanted to write them that way. The writers didn't justify why Electro was specifically in the movie.
In TASM, the Lizard had a reason to be there. He and Peter were both missing pieces of themselves and trying to fill those pieces in: the Lizard is doing that through his scientific experiments to regrow his arm, while Peter uses Spider-Man as a way to deal with the trauma he's suffered. They are kindred spirits forced into conflict when they try to set out to rectify the injustice in the world. Green Goblin would not have been a good villain for TASM, neither would Dock Ock or Electro or any other villain. The Lizard is in the movie because he has to be for the story to work.
Furthermore, Electro's arc is completely dropped at the end of the movie. Peter stops trying to save him. He never once tries to talk him down during the power plant fight (which I loved he did during the high school Lizard fight in TASM). The movie seemed to forget that Peter's a hero first, action star second.
Peter's arc with Electro is never completed because he never tries to make up for his failure, and Electro ends up having zero thematic resonance at the end of the movie. When the climax rolls around, he's just the blue guy Spider-Man has to defeat to save New York. Peter doesn't learn anything in order to overcome Electro - he uses brawn and scientific knowledge to defeat him, but doesn't learn anything about becoming a better hero. Peter doesn't try to become the better man.
In Spider-Man, Peter accepts Uncle Ben as his father figure, and is not fooled by Norman's attempts to convince him to be a son to him. In Spider-Man 2, Peter learns to sacrifice his dreams to do what is right, and instead of beating Doc Ock to a pulp at the end, he outright convinces him to help him save New York (which is what he could've tried with Electro). In Spider-Man 3 (I can't believe I'm praising this movie), Peter learns to forgive Harry so they can take on Venom and Sandman together and win, then forgives Sandman at the end when he realizes that everyone has done bad things, and the "bad people" might feel as terrible as he does, ending their conflict and years of torment for both.
Also, I find it hard to take Electro seriously as the main villain because he's such a reactive character. Most great villains - Darth Vader, the Joker (Batman & TDK), Ernst Stavro Blofeld, Doctor Octopus, and the shark in Jaws - are proactive presences. They are the ones who initiate the conflict and continually challenge our heroes.
In TASM, the Lizard's first appearance causes Peter to actually INVESTIGATE what happened to Connors and prove that he has become a monster. The villain forces Peter, already a proactive character by then, to alter his goals and take on a new challenge.
Electro never does this. He gets pushed around constantly as Max, which is fine, but when he becomes Electro, he gets promptly locked up and never escapes until Harry, the most proactive character of the movie by far, breaks him out. Electro then becomes Harry's lackey and initiates a very late in the game battle. For a main villain, Electro has no effect on the lives of Peter and Gwen until the final thirty minutes.
Seriously, Peter immediately forgets about his first fight with Electro and never once investigates what happened to that lowly Oscorp worker he once met. The only thing he does afterward is try to figure out how to make his webshooters resistant to electricity, but that scene is very brief.
It's bad writing when the supposed main villain barely determines the progression of the plot.