I've had this problem with my iPhone 4 since updating to iTunes 10.
I get an error message 13019 when trying to sync. Online support suggests several things at
http://support.apple.com/kb/TS2830 but after trying everything here I had no success. The weird thing was, when removing all music from my iPhone, and then putting it back again, it only synced exactly what was there before. The new music I want to sync stays off my phone.
One other thing I noticed is that every time I tried to sync, my phone had a new, and empty, 'On The Go' and 'Genius' playlist created. Don't know if this means anything. I've gone through and deleted around 20 useless playlists.
Have successfully got the music onto a 30GB iPod (circa 2005) running software version 1.3 so must be something to do with the combination of iOS 4.0.2 and iTunes 10.