I have found the exact cause of the problem. I had the Stayputnik with the altimetry, biome, BTDT and antenna on the four sides at right angles to each other. The altimetry and biome sensors were placed horizontally. When I activated the biome it extended through the BTDT and it is this that caused the spinning. It changed some value in the save file because the "phantom torque" was in everything from that point on, even space planes I build afterwards with stock parts and no SCANsat parts. It even persisted after I uninstalled ALL mods. The only way to get rid of it was to start a new game.