I've played gens 1, 2, 3, 4, and 6 (also 5 but too little to judge).
Gens 1 and 2 were the absolute best in terms of freedom of exploration. It had almost no plot which I think is best because it made the games less linear. You could do a few gyms in any order you wanted, and the legendaries were not part of the main story, you really had to go out of your way to find them. I remember as a kid when I stumbled across my first legendary (Zapdos), it was a huge surprise and it wasn't part of the main story, it was completely optional and sort of a reward you got for exploring the region. I think that's how it should be with legendaries, they shouldn't be part of the main story like they were from gen 3 onwards.
As I see it, the gen 2 games are basically gen 1 on steroids. They took everything good about gen 1 and added tons of great new features on top of it (breeding, day/night cycle, new types, new moves, shinies, two regions, etc). Literally the only criticism I have of the gen 2 games is their horrendous level curve.
Gen 3, however, despite the box legendary being part of the main story, made something even better than anything in gen 1 and 2 in terms of hidden legendaries: the Regi's. It was completely optional to get them and you had to solve a hard problem (although in my case I got lucky because I got the manual with braille, which apparently not everyone did, so I was able to figure it out), these 3 bad boys definitely weren't handed to you! That's, again, how it should be with legendaries.
Other than that, I loved the Hoenn region, it was vast, had tons of places to explore, and the music was amazing. Also, Emerald had the Battle Frontier, which is still my favorite post-game content in any game I've played.
Also, one of the absolute best novelties in gen 3 has to be the PC system, which became much smoother to handle compared to gens 1 and 2.
As to gen 4, it also had a lot of great novelties, namely the possibility to trade and fight online. The Sinnoh region was very enjoyable and Platinum made it even better with the Distortion World, the Battle Frontier, and a more extended pokédex with more fire types. Contrary to gen 2, gen 4 (especially Platinum) might have been the best generation in terms of difficulty, the level curve was perfect. They went a little crazy with the legendaries, though, they were way too many in Sinnoh. Legendaries are supposed to be special!
Gen 6 was beautiful, I thoroughly enjoyed the 3D graphics, but obviously these games were way too easy and linear and had way too many dialogue and plot, which took away the freedom you had in previous generations. Which is a shame, because these games (both X/Y and OR/AS) had a lot of potential and could've been among the best games in the series. Too bad the Z version, which could've fixed a lot of issues with X & Y (like Platinum did with Diamond & Pearl), never came out...
All in all, I'd say the best games I played are Emerald, Platinum, and HeartGold. So it's very close, and I actually prefer Johto and Hoenn over Sinnoh, but I guess I'll vote gen 4 since that's when both Platinum and HG/SS came out.
Honestly, none of them. Each gen has its virtues but also its flaws. Some are good for their features, more updated and compelling mechanics, some for their challenge or level curve, some for their region, Pokémon roster, etc. But there's really no Pokémon game that is good at everything.
Of course, but the question isn't which generation has no flaws, it's which generation is the best compared to the other ones, not to some imaginary game with no flaws.