I had this same problem once when I completely disassembled a bike for painting...which included removing the headtube bearing cubs. I wasn't aware (at the time) that the top and bottom cups are slightly different. In reassembly, I inadvertently put the top cup in the bottom of the head tube, and the bottom cup in the top of the head tube. When the complete headset was reassembled, it pretty much pivoted OK by hand, but when riding (with no hands) it just wouldn't track straight. I thought I have bent the fork or frame somehow during the disassembly/assembly. Not sure what eventually clued me into reversing the headset bearing cups...but once I did everything worked as it should.
Dan