How can I programatically change the color of node title in views results?
An easier (and more maintainable) way to achieve this would be to set a class in your span, instead of hardcoding the style. Something like the following:

$span_open = '&lt;span class="my-title"&gt;"';


You can then add a CSS file to your module, so that you can better specify the color, also overriding the a tag. For instance:

.my-title, .my-title a {
  color: green;
}


For more details about adding CSS to your module, see https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_css/7.x