Basically I believe it's so the player doesn't decide to change their mind and go to a different member of the four heavenly kings/elite four (well in the newer games that is where it isn't a straight line like in some of the older games like fogo Red,Diamond etc. but even then the door closed locked behind the player I think it's because if it didn't lock then the player would be able to go out and go back to the Pokemon Center or the Poke Mart in the games where they were connected..I think those are the main reasons why.