Hatchlings will spin and twist in the final throes of death. I wouldn't jump to IBD or spider spinning. I would speculate that if it had mites, it was wild caught and probably the stress weakened it's immunity to the parasites it had, causing them to overwhelm the snake.

It's a sad time for you, I know. Just make sure next time to buy from a respected shop or breeder. Buy only captive bred snakes and you will be better off.

Rick