The difference was more the US soldiers went deep in the Nazi occupied Europe, more they were convinced of the just cause they were fighting (and dying) for. Not only the SS killed their prisoners, but all the civilian populations welcome them (even the Germans). To ignore (at least for the ground soldiers) the existence of the Death camps and to liberate one gave you a good hint of Hitler’s regime.
WW2 was imposed on the US. The morality was on US side, the legality was on US side.

It is quite different when you go in war to find WMD and to capture and destroy evil terrorists linked with the one who attack your country and find out there is none of these. Then the populations you liberated started to be unhappy because you are still here, imposing your view on how they should run their country and worst, to take their money and pretending you give them money.

It is not the public opinion which changed; it is the reasons for the war.