The Fourth Amendment to the U.S. Constitution protects you from random traffic stops (although checkpoints for drunk drivers and undocumented persons are allowed). In order to lawfully pull you over, the police officer must have "probable cause" to believe that you've committed a traffic violation or "reasonable suspicion" of criminal activity.
If you're lawfully pulled over, can the police order you out of the car? The answer is, yes. And the officer doesn't need to give a reason.
Why? Because the Supreme Court has held that the benefit to police officer safety (protection from assault or accidental injury) outweighs the "minimal" additional intrusion on a driver's liberty that is caused by being ordered out of the car during a traffic stop.
And what if you're a passenger? As with the driver, the police also have the right to order a passenger out of the car as a precautionary measure even if there is no reason to suspect that the passenger has committed a crime or poses any risk. Again, for safety reasons, the Supreme Court has found it reasonable that the police officers have "unquestioned command of the situation."
So if you find yourself lawfully pulled over for a traffic stop, be aware that the police have the right to order you out of the car as a matter of course and they don't have to give a reason. The Supreme Court has held that this is a reasonable police power and doesn't violate your Constitutional rights.
Dedicated to protecting and advancing your rights,