My guess is that the writers still keep the kid audience in mind, and you'll always have a new set of kids that will be introduced to the Pokemon franchise, possibly from the anime. Perhaps the writers keep on making Ash lose because they want kids to learn that they can't always win everything, and as children grow up and see that Ash keeps on losing, they'll probably have moved on to some other aspect of Pokemon for them to enjoy, but yet again, you have a new set of kids that will be introduced to the anime, and then they'll learn about the meaning of loss. It's basically on ongoing cycle.
For me, in the events leading up to the Kalos League, I've learned to not get my hopes up that much about Ash winning the League. As much as I want Ash to win a League, I've also come to accept Ash losing because the writers want to keep on teaching the lesson about losing to the new batch of younger audience. I've come to watch the anime not to see Ash win the League, but rather to see how Ash and the people he travels with develop throughout the season and what kind of events will unfold as Ash reaches the League. If Ash and the other important characters in the season develop well and the events are entertaining enough to catch my interest, I'll watch the series.
In the case of a series like B/W, I didn't enjoy it because Ash didn't develop very well, returning back to his immature self like he was in the original series, not to mention most of the other characters weren't very enjoyable, most events throughout the season were not written too well (whether it'd be the poorly-done Team Plasma arc or that pointless filler season where Ash and the gang travel from island to island on their way to Kanto), and things felt too formulaic overall. I think the only things I really enjoyed from BW was how Meloetta interacted with Ash and Cynthia's return and that was it. Pretty much lost an interest in the anime at the time.
For X/Y, different story. One of the main reasons I gained a renewed interested in the anime was because of Serena and how the pre-release advertisements mentioned she was a childhood friend to Ash, and man was she worth the hype. Easily the best female companion Ash has ever had IMO. Not only is she the first female companion to have a crush on Ash, but she undergoes really good character development as the series progresses, both as a performer and a friend. Clemont and Bonnie were also enjoyable too, and characters like Korrina and Alain got some interesting spotlight. Battles are more hype worthy to watch in the series thanks to the highly improved animation. Ash himself is also more likable, showing some great development in episodes such as the one after losing to Wulfric and and the way he handles his Kalos League finals loss, and displaying more maturity compared to other seasons.
And while the writers will still keep formulaic writings such as Ash losing the League and Ash leaving behind his friends from the region at the end of the series, they still made some interesting changes as the series progressed. In addition to Serena being the first female companion to having a crush in Ash, she is also the first character in the series to cut her hair halfway through the series to represent a change in her personality (a common cliche in anime, yes, but this hasn't been done in Pokemon until now). Then, there's Ash losing two Gym Battles instead of one (last time that happened was in Kanto), good symbolism (such as the flashing lights in the hospital hallway in Mega Evolution Act IV when Alain overhears Mairin crying to symbolize inner conflict, the bonfire in XY&Z episode 8 that symbolizes Bonnie's growing despair over Squishy's absence to the point that one of the logs in the fire falls down, representing the moment Bonnie's despair peaks and starts to cry, and the snowstorm in one episode to symbolize the trouble Ash and Greninja face with the the evolution of the Vivillions following the storm to symbolize a new beginning for Ash and Greninja), and darker moments in the series such as the events in the Team Flare arc (which also deserves a mention for being the best villainous team arc in the entire anime, blowing the past three out of the water).
TL;DR - If a season in the Pokemon anime gets good development throughout it such as many memorable battles, Ash, friends, and even rivals developing as characters and becoming likable in the process, and perhaps even the writers changing up things not counting the League and the end of the season, chances are I'll get hooked onto that season of the anime. If Sun and Moon will have good battles, likable characters, good writing, and not reset Ash's personality, I'll probably be hooked to it as well, but I'll judge if it'll be worth watching once I see the first 5-10 episodes.