Similar as what others have said. I think ageism hits female artists more, you sometimes hear people saying how Super Junior is Super Ahjussis or sth like that, but I think in general older male idols are still seen as pretty good-looking, I mean artists like Super Junior, TVXQ, Big Bang and 2PM, when people start saying female idol is too old when they hit 25 or sth like that. Like there has been non-stop discussion of Irene's age, how she's ahjumma and too old for the group.
Then it's fan loyalty, some male fans seem to chance more easily to younger newer groups when female fans seems to be more loyal in general (which is why it's also easier for male idols to get through scandals, they get more support from fandom I think). Female artists in general have smaller fandoms and more casual listeners, so no wonder they have less loyal fans then.
And I also think companies are following this too, they are more easily replacing older girl groups with newer to keep themselves on game. Many of older girl groups that were suddenly disbanded or haven't had comeback in ages still got it, I mean they have the talent, they even have fandom- but company has shifted their focus on newer and younger girls.