Whenever they pull someone over, which is often, they have to judge what you're going to do. For them, the chances of you doing something crazy like speeding off, pulling a gun, etc. is not insignificant. That's what they're thinking about when they're walking up to your car. They've been trained about what things to look for. And getting out of your car is the way many violent interactions begin.
If you just get out of your car and act nice, I doubt it could really be a problem. It's just a dicey thing to do, making any sort of act that could be perceived as aggressive towards an officer.