In Star Wars 3 after Order 66 was given, the clone troops were following their chain of command in service to the commander-and-chief of the Republic, Chancellor Palpatine. If their purpose was to serve and defend the Republic, regardless of the faked jedi uprising (in which they believed they were following orders), why didn't the clones turn on Palpatine to defend the Republic when he converted it to a Galactic Empire? Was it because the formation of the Empire was voted on by the Senate (where Padme said "So this is how liberty dies, with thunders applause.")?
I'll just go with what we know from the films and cartoons from the clones. They were bred to be subserviant. To follow orders and to protect the republic from all its enemies (and the implanted order 66 ensured even against the jedi if necessary).
The few that probably rebelled aside (we saw in the series that it happened from time to time that single clone troopers rebelled and either fought their former comrades or fled) they all served the republic and its will.
When the chancellor let the senators vote he used the system of the republic against it. If they had downcast the vote he would have lost and the empire couldn't have been created without the clone troopers having to do something against that but if he won the vote the republic cast away its name and the name of the position of the chancellor and it would have been the WILL of the republic to do so.
Furthermore even though he renamed his position and the republic it was still the republic at that time that is until the senate was disbanded almost 20 years later! With that in mind aside from name changes and a few bureaucratic changes from the perspective of the clone troopers nothing really changed. They followed the will of the republic when they did not act against the renaming and that aside it was STILL the republic for them (only now called the empire).
So no reason for them to rebel.
The command for Order 66 was to target Jedi and kill them. Palpatine was not a Jedi, so this order would not result in the Clone Troopers attacking him. In fact it gives him temporary command over them.
Order 66: In the event of Jedi officers acting against the interests of the Republic, and after receiving specific orders verified as coming directly from the Supreme Commander (Chancellor), GAR commanders will remove those officers by lethal force, and command of the GAR will revert to the Supreme Commander (Chancellor) until a new command structure is established.