you can't do practice swings in the sand, I don't think that's what he was doing, but you can swivel and approach
the ball without a swing. His crime was pushing sand out of the way in this surreptitious way of approaching the ball, improving the lie. You definitely cannot do that, as you point out.