Brock only became the Gym Leader because he felt it was his responsibility, and he admitted to Ash that he would rather care for Pokémon than battle them. It was his dream to become a great Pokémon Breeder, and when Flint took back control of the Gym, Brock was allowed to start following this dream. Most notably, he took care of a Vulpix that belonged to a Breeder named Suzy. Shortly before Vulpix was returned, Brock used it in a Pokémon breeding competition.
Brock started travelling with Ash because his dream was to become a Pokemon Breeder and he wanted to adventure the region. (In anime breeding is different, it's like feeding Pokemon their food and making food for them, and raising friendship and stuff like that) Throughout the anime you could see that he'd take care of the Pokemon and make food for them.
Cilan guided Ash to the gym, which was a Cafe, and that confused Ash but then Cilan revealed he and his 3 brother were Leaders of the Gym, they were shocked when Ash said that he wanted to battle all 3 of them, but they accepted. After Ash earns the Trio Badge, Cilan meets up with Ash in a Pokemon Center and begs Ash to tell him his battle secrets for future reference as a Connoisseur, after spending the day with Ash and Iris, Cilan decided to accompany them.
In the first episode, when Ash is ejected from the Lumiose Gym, Clemont and Bonnie rush over to help him, while Bonnie caught Pikachu, Clemont used his Clemontic Gear to save Ash. Ash asks Clemont to battle him. He accepts and battles Ash with his recently caught Bunnelby, Clemont proved to be a good battle and managed to counter many of Ash's attacks. The battle was, of course, interrupted by none other than Team Rocket, they wanted to steal Bunnelby and Pikachu, then a Froakie came in between and blasted Team Rocket. The Froakie was injured and they took them to Prof. Sycamore.
In another episode Ash saves a rampaging Garchomp, and also saves Pikachu by jumping of the Prism Tower.
In the episode where Ash catches a Fletchling, Clemont and Bonnie decide to accompany Ash, throughout the episode Clemont admires Ash's skills. Another reason could have been that Clemont wanted to leave Lumiose to avoid Clembot but I couldn't find anything on that.