A number of years ago (more than I care to remember) I read a similar question in a newspaper Q&A column. The response was that in the wild, a dog will try to settle down with its nose into the wind. Hence the circling.
Not having been enlightened by Cecil at the time (indeed, this was long before Cecil deigned to share his wisdom with us), I accepted that explanation as plausible. Now, I wonder how I could have been so gullible (since the wind is notoriously changeable). Still, I present it for what it’s worth (which ain’t much, but at least it gives me an excuse to post something).