Generally beginners are taught to castle as quickly as possible in order to get their king safe and it quickly becomes a habit. As they get stronger they realize that in many positions delaying or foregoing castling can be beneficial, and that castling kingside too quickly can even lead to quick destruction in many cases, and so it becomes less of an automatic response. So it's a gradual change in understanding that occurs as skill increases, not some sort of dichotomy that exists between amateur and master chess where a light suddenly goes on when you hit 2200.
Also, I think one of the characteristics of modern chess is trying to be as flexible as possible in the opening and keeping your intentions hidden. So it's often seen as a good thing to avoid setting in stone your king's address for as long as you can.
What I've noticed is that, at class level play (<2000) that 80% of the time, people are castled kingside. Then about 15% people will be castled queenside, and rest won't have castled at all.
At strong levels, I've noticed that castling varies A LOT. I see people castling queenside, when it's wide open but safe, but in that particular opening, castling kingside is always the way to go. There are a lot more queenside castlers and non-castlers at high level chess.
I know this because if you look at Josh Waitzkin's annotated games in Chess Master, he shows games in which the players keep thinking, "Kingside? Queenside? Or not at all!" It's a constant thing going on in their heads.
Meanwhile club players just castle kingside most of the time...
Why is this?