I had intended for punching in a different direction to work as a dodge move.
The spinning is just a bug; the player is made up of an object which controls the movement and a child of that which has the sprites and rotates to face the mouse, except while punching. The spinning appears to be caused by the parent object spinning after moving alongside a wall. I thought that would affect movement but apparently not.