Because he was programmed to be there, but I suppose you want a more logical explanation explaining how he got there?
Just because the player needs to complete the Pokedex to get to Stark Mountain, does not necessarily imply that Barry does too.
But if that's the case with all trainers, then it's just Game Freak logic because Barry didn't receive a Pokedex from Professor Rowan at the start of the game.
>After becoming the Sinnoh League Champion, the player can find him training at Stark Mountain during the week, and at the Fight Area on weekends, ready to battle. Unlike the player and Lucas/Dawn, Barry did not receive a Pokédex, due to him rushing out of Professor Rowan's lab before Rowan could give him one.
How do we know though that he didn't receive a Pokedex at a later date in the game? Such as if he went back to Professor Rowan's lab to receive his Pokedex, or Professor Rowan/Palmer travelled to meet him to give him his Pokedex etc.
But he is the Champion after all so why shouldn't he be allowed there to train? Palmer or Professor Rowan could have also granted him access to Stark Mountain.