“Very bad case of OCD.” Well at least you are honest. ??
It doesn’t work because ‘the_post_thumbnail’ is not a valid filter. You need to use ‘post_thumbnail_html’ if you want to filter the output, like this:
//remove class from the_post_thumbnail
function the_post_thumbnail_remove_class($output) {
$output = preg_replace('<code>class="(.*?)"</code>', '', $output);
return $output;
}
add_filter('post_thumbnail_html', 'the_post_thumbnail_remove_class');
I still don’t understand why you think adding a 5-line function (and a function that uses a regex, no less) in order to remove a class name makes your code any tidier. But, to each his own! ??