There seems to be several solutions to this, becuase there are several sources to the problem.
Here’s one concerning the problem with spam comments in the database table:
http://wordpress.org/support/topic/154571
And here’s one with the wrong ping service:
http://www.seandeasy.com/wordpress-posting-issue-solved-at-last/
My problem got solved by checking the miscellaneous settings (Settings / Miscellaneous) in the admin panel. The “store uploads in this folder” field MUST have a value. In my case the default “wp-content/uploads”