Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
I'm not sure, but I think that it's the save state doing it. If my suspicion is correct, data for the pokemon was generated before you opened the box, possibly as far back as selecting "new game".