I didn't play Battle Network or Star Force because they're not in the main continuity or a continuity very similar to it, so I don't care about them. In the main continuity, this is the ranking I think is best:
X > Classic > Zero > Legends > ZX
>X
The first serious hints of advancements in the series' mechanics came from X with dashing and wall jumping, and out of all the different subseries, the X games were the ones that most consistently brought some new mechanic to the table, usually in the form of armor upgrades. Also introduced Zero, which is arguably the only good thing Keiji Inafune did. X is a great character and with his series, Mega Man's storyline started tackling more sophisticated themes. Ironically, when the SJWs came into the videogame community they were professing to be in favor of that exact thing, and yet the stories and characters they write are inferior to Mega Man, or indeed almost any video game story written before they invaded. Mega Man is probably the only series where the "deepest lore" meme is unironically true, and it's mostly because of X. Sadly people hated X7 and that did a lot of damage to Mega Man as a whole, which is too bad because despite its flaws it gets much more hate than it deserves. Maybe now that it's being re-released on PC, some intrepid modder will mod it until it's up to the standards of the rest of the series.
>Classic
Still holds up surprisingly well even after how many years it's been. No diagonal attack with the Mega Buster is somewhat annoying, though. That's never really remedied in Mega Man in general for the most part except for Legends and the later X games.
>Zero
Hard as fuck, so you need to man up and git gud, but it's very rewarding once you do. Pulls off the post-apocalyptic vibe very well and manages to make the oppression of Neo Arcadia feel real, and introduces a variety of different mission types unseen in Mega Man until then. The Cyber Elf system in the first game was wack, though.
>Legends
One of the few post-apocalyptic series that manages to have a really fun and wondrous atmosphere. Sadly it only got two main games.
>ZX
The transformation mechanic was interesting, but there's really nothing there that couldn't have just been made into an armor for X, or even Zero despite him getting very few true armor sets as opposed to palette swaps. Still, it was nice to see a more upbeat world after the oppressively dark atmosphere of the Zero series. It makes you feel like the heroes actually accomplished something.