Exclude Category ID in function

I think has_category() should help you.

function info_after_post($content){
if (is_single() && ! has_category(71)) {
$content .= 'AD CODE';
}
return $content;
}
add_filter( 'the_content', 'info_after_post' );