I tried to replicate your issue and while the dev tools show it as alt the source code shows alt="", so WordPress is not stripping the quotes, it's just the dev tools being concise. But even if it was, they're equivalent so alt and alt="" are the same.
As for why the dev tools display alt, it's because the dev tools don't display the HTML,...
Your problem can be solved using CSS and a small filter. Your proposed solution is not viable.
Your conditional is in trouble.
get_the_category() returns an object, use foreach to find the specific category.
In addition, you assigned a value to the $categories variable, to compare you must use the comparison operators ( Ex: == or === )
I refactored the code and adapted it to your case, I hope it helps.
add_action( 'save_post', 'wp_force_featured_image'...
<img src="<?php echo get_template_directory_uri().'/images/sample.png'; ?>">
Try this. It should work.
You have to concatenate the results from get_template_directory_uri() and your images directory in echo.