The Pokemon anime is pretty much just a big commercial, and the cast reflects this.
Original
Ash: He's the protagonist.
Misty: Kanto character
Brock: Kanto character
Advanced ( A fresh start, to an extent.)
Ash: He's still the protagonist.
May: Advertises RSE
Brock: Advertises FRLG
Max: It's possible that he was included to "insert" the viewer into the world of Pokemon. Four people was also a nice change of pace.
Diamond and Pearl
Ash: He's still the protagonist!
Dawn: Advertises DPPt
Brock: Advertises HGSS
Black and White ("Forget the past!")
Ash: Guess why.
Iris: Unova character
Cilan: They needed someone to cook.
As you can see, Brock can't advertise a game from the current generation anymore. Brock stuck around instead of Misty because the developers wanted to give us some new "eyecandy", it was stated in an interview. Brock also stayed for a while so that all the changes wouldn't have such a huge impact on viewers when a new saga begins. This is the reason Ash's Advanced outfit was very reminiscent of his Original one. This is also why he always wears similar caps. If Ash completely changed his wardrobe people wouldn't have been able to identify him as easily. Let's not forget that Brock wants to be a doctor. I think he's gotten enough field training by now.
tl;dr
Brock can't advertise any games anymore, so the writers made him a doctor and sent him off on his merry way.