It honestly depends on what you liked the best out of each generation. I've already said that if I had to choose, it would be 5th gen, but I'd like to elaborate more.
See, each person has stuff they like, and for them, it's what may boost a generation to their "favorite" even though perhaps overall the generation didn't bring as much in to the bigger picture.
I hear a ton of people talking about 3rd gen, and believe me, when I got Ruby I played the everloving shit out of that game. I restarted over and over for ages. I loved the music, the legendaries, the new sprites. Abilities were cool, contests were amazing (why the fuck did GF take them out of future titles, I want them back dammit. And the atrocity that was the 4th gen contests don't count). I played the shit out of LeafGreen when I got that too, and the nostalgia factor was a huge part of it. Also had the best Champion music until this day, hands down.
4th gen (D/P/Pt) was alright. Nothing really stood out for me, besides the Physical/Special split which was fantastic. But if I had to choose one thing that made 4th gen memorable, it was the Distortion World. That place was the epitome of amazing design. It bummed me out that you couldn't visit it again after it was done, and that nothing like that was ever used again in future games. Also, Giratina. Fucking Giratina. I battled that SoB and it was glorious. I literally set my game down after the battle swoosh and did something else, all the while listening to the amazingly dark music. And then it beat the shit out of my team so many times that I just went "fuck it" and used a Master Ball on him.
HG/SS, as said before, is a bit unfair to be lumped into the same category as D/P/Pt. It's a throwback to the good old 2nd gen, but with far more stuff. The amazing remixes, the better graphics... AND YOUR POKEMON FOLLOWED YOU AROUND. THIS WAS THE BEST PART. WHY HAS THIS BEEN ABANDONED GAME FREAK.
Now for 5th gen. Overall, it didn't add a whole lot. Breeding mechanics were great. Reusable TMs were something that should have been done ages ago. Cool moving sprites. Great, but there were a lot of annoying stuff too. The bag was utter trash, the sprites looked shitty close up, and BW2 was kind of an eh sequel, though the World Tournament more than made up for it.
So considering these points, it's fair to see why so many people chose 3rd gen as their favorite, because overall it introduced the most stuff.
But for me, I chose 5th gen because I loved the story. Sure, 5th gen was a bit bland overall, but in terms of story, nothing in past generations beats it. Here I am, still playing Pokemon 13 years later after playing Yellow as my first game, and my tastes have changed over the years. I crave deep storylines in games, and 5th gen showed that it was possible to do in Pokemon. Sure, it ain't no Tales of Symphonia, but we were given a great antagonist, N, who literally wanted to put the world in terms of Black and White. He was a young man filled with ideals and most importantly, conviction. And it was over the most essential part of Pokemon: the bond between Trainer and Pokemon. By advocating to sever that bond, you had to ask yourself, "what am I really doing with my Pokemon? What are they to me?" And the two legendaries were great as well, representing the clash of ideologies between the main character and N. And in BW2, N comes back, with something almost unheard of in a Pokemon game: he has character development. He realizes that perhaps he must have a new outlook on the world, and he not only says so, but he shows it. Many other previous characters have said to change, but nothing to show for it (besides maybe Silver). N is different, and even has his releasing of his legendary as a symbol.
This is why I'm not surprised why 5th gen is pretty low on the poll. Most people who play Pokemon don't really give two shits about the storyline. But for me, it's the most important, and which is why I'd pick 5th gen as my favorite. Sure, it has its flaws, but it was a huge leap in terms of storytelling compared to previous gens. And seriously, when N's castle popped up near the end of B/W, I was nearly orgasming over the sheer awesome. I remember playing through that part in B/W and thinking to myself, "since when was I playing Final Fantasy? I thought I was playing Pokemon."
Now, like I said, I do like 3rd gen, but years later, looking back at the games, I honestly can't see the appeal. Hoenn is literally mostly water, and surfing around everywhere got tiresome real fast. The rival was pretty meh, especially since it came after the game with pretty much the best rival ever (in terms of a character), Silver. Re-listening to the music, it overall was alright, save for the Legendary theme, Regi theme, Mt Pyre and the E4/Champion themes which were the best out of a generally bland soundtrack. Compare that to HG/SS or BW/BW2 where literally there was no theme I didn't like. 3rd gen and Hoenn in general hasn't really aged well over the years imo, and tbh that's exactly why I'd like the see a remake of it sometime, simply because I'd want to see it updated.
X/Y as a generation is shaping up to be quite good. I dislike the bland storyline (seriously why the hell is it so short) but there's a slew of new things that made me happy. Breeding, for one. Also, AMIE. oh my god Amie. Now if we got back the HG/SS "Pokemon follow you around" gimmick with Amie in a later installment, there's nothing more I could ask for.