While she doesn't look as young as, say, Bugsy, my personal head-canon for why she acted this way is that she's a newer Gym Leader in a big city that's far away from where she might have been raised, and that as a combination of the stress of moving to a big city and the stress of Trainers frequently taking her for granted, she has a rather unfortunate emotional instability that she has to try and hide in public. If you were a newer Gym Leader who Trainers were taking for granted only to actually lose against said Trainers, thus adding validation to their arguments... you'd probably be pretty upset too. I'm not trying to defend Whitney's behavior, but in-game I can totally understand where she's coming from. Moving to a big city at such a young age before she had time to learn how to act in public can absolutely do that to a person, though I don't speak from experience as much as I'm just analyzing a fictional character in a video game for kids.Too bad after you beat her she starts crying like an infant, to the point you almost don't even get the badge. Like, seriously, it's been a LOOONNNGGG time since I've played HGSS, but I'm pretty sure after you beat her she doesn't give you the badge no matter how many times you try to talk to her and what you're supposed to do is try to leave the gym until the guy at the entrance stops you because you haven't gotten your badge yet and then go back and talk to her to get it. ... Are you kidding me? Seriously, I know that it may not seem that bad, especially since it takes no more than a minute, and Clair's situation is WAY worse, but the fact that even happens in the first place is beyond stupid. You're a Gym Leader for crying out loud, why are you acting like such a spoiled brat. At the very least they didn't carry that aspect of her over to the anime.
That being said, this argument only gets stronger when you compare Whitney to Clair, someone who is not only older than Whitney more than likely, but also runs the Pokémon Gym where she more than likely grew up. Right out of the gate Clair has two less excuses to act the way she does compared to Whitney, and it brings into question where Clair may have picked up her behavior from. This is just another head-canon, but it's possible her behavior may be reflective of Lance, someone Clair has to look up to yet himself doesn't always act on his own teachings. Lance's Kanto Elite Four iteration notably has a bit more of a cocky demeanor than his Johto Champion iteration, so while Lance himself may have matured a bit in those three years between games, Clair herself may still be in the middle of that developmental learning process. After all, it's not like a three-year-old is running the Blackthorn Gym and that she wasn't born yet at the time of the Kanto games.