How to Prevent WordPress to encode html in post?

Save post when in HTML tab of editor. It should be saved as close to what you see in editor as possible. I had run couple of quick tests and ampersands are not encoded in this case (as you want to).

I am not sure how to prevent this for visual editor, because a lot of formatting-related stuff in editor is handled by JavaScript rather than PHP.

Update

Cleaning up your snippet, this seems to work:

$content = get_post_field('post_content', XXX, 'raw');
$content = str_replace('amp;', '', $content);
$wpdb->update( $wpdb->posts, array( 'post_content' => $content ), array( 'ID' => XXX ) );