Many have overlooked the obvious idea that your legs might simply be a lot stronger than your upper back. It takes a lot of strength endurance to keep your shoulders retracted and in the proper position when holding a heavy barbell on your shoulders.
How many reps are you doing in the exercise? A lot of coaches recommend doing no more than 5 in a set because of the very problem you describe.
To help with the elbows, think of bringing them both up and squeezing them inward a little. Your upper arms should be about parallel to each other, in contrast to your elbows splayed out to the sides.
Remember to fill both the belly and chest with air on this one, too, then brace hard (another reason for the 5 rep maximum recommendation).
Don’t use the Smith machine for learning the form. As has been said, it’s colossaly stupid.
Use the clean grip - it’s safer, more stable, and you can handle more weight once you learn it. If you lack the flexibility for it, short of a genuine structural abnormality, stretch.