Problem
When running iPhone OS 4 beta 1, syncing with iTunes doesn’t backup the iPhone causing the error:
Fix
Install the iPhone SDK 4 beta with Xcode 3.2.3 (or later), which will update some files in iTunes and enable the backup to complete successfully.
An iTunes update is likely to be released soon to address this and other issues some users are experiencing with syncing.
Update 25/04/10: Apparently iPhone OS 4 beta 2 backs up in iTunes 9.1 without any issues.