Adding HTML to posts with certain tags?

Welcome to WPSE. Additional markup for certain posts is more appropriately included in the template for that content type. If these are blog posts, then single.php is the likely template used for display, depending on how your theme is structured.

The likely problem with the code in your question is that you are not using an array to pass multiple parameter values to the has_tag() function. What you have entered is a space delimited list and not a proper PHP array. Using array( 'x', 'y', 'z' ) would be correct.

If you move this to your post template, you are able to eliminate the hook to wp_footer as well.

if ( has_tag( array( 'X','Y','Z' ) ) ) { 
?>
      // My HTML Code goes here
<?php

}