CHEYLETIELLA or more seriously---syringomyelia/arnold chiari.
Could also be habit, I inherited a dog from an alzheimic and he just scratched, after all the tests which revealed nothing,so I used to spray [a short sharp burst] with fresh water and eventually he stopped.
Also, tea tree/lavender oil mixed with water rubbed on soothes.