Why does the TARDIS spin during flight? I'm looking for both in and out-of-universe explanations? Has it always spun like that? If not, when did the spinning start?
Also, I haven't seen series 9 yet, so please hide any spoilers.
The TARDIS spinning was a very early and inexpensive special effect. The earliest I recall seeing it was in some Patrick Troughton stories, but it may have dated back earlier, to the Hartnell era. It was accomplished by placing the TARDIS model on a small motorized turntable; then the turntable and the background were replaced by the starfield. The net effect was to show the ship in motion in outer space, without requiring anything that would require moving the camera, or the backdrop, or the model.
There was never a clear idea in Doctor Who of how the TARDIS moved. Since it dematerializes and rematerializes, it doesn't make a ton of sense that it should be physically present in outer space while it is traveling from planet to planet. On the other hand, somebody on the production staff must have decided that they wanted to include the ship moving physically through outer space. It gives a least some measure of feeling to the idea that the TARDIS is really going somewhere while it is in transit.
As I understand it, the rotating TARDIS effect was quite iconic among British fans of the show. (That was not the case at all in America, when Doctor Who became popular there in the 1980s. The '60s-era shows where the effect was used were mostly lost, and those that remained were not shown very much in comparison to the episodes featuring the third through seventh Doctors.) It was sufficiently famous that it featured as a gag in a behind-the-scenes parody of "An Unearthly Child" that ran in the twentieth anniversary issue of the official Doctor Who magazine. Appearances of the rotating TARDIS in the new show must be allusions to the original cheap effect from half a century ago.
I thought the first time the TARDIS was shown spinning was in the Tom Baker story "Pyramids of Mars". However, this link suggests that the first time was the last episode of the Jon Pertwee story "Frontier in Space" (see the comments by galacticprobe) (it had been difficult to check up on this, since when use the search term "spinning TARDIS" mostly get links to the toy).
However, according to the BBC: The first story to have the TARDIS rotating as it travels was in the Jon Pertwee story "The Time Monster":"For the first time, the Doctor identifies the realm through which the TARDIS travels as being the ‘vortex’, a term that would be regularly used throughout the rest of the series. It’s also the first time that we see the TARDIS exterior spinning as it travels. This would become a standard in future stories".
As far as the science is concerned, have a look here about Tipler cylinders which involve rotation of sorts.