Adding shortcode closing tag after a loop

Collect all of the loop’s output in a variable, wrap it in the accordion shortcode, then pass that through do_shortcode:

$output="";   

if ( have_posts() ) :
    while ( have_posts() ) : the_post();
        $output .= '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">';
        $output .= do_shortcode('[su_spoiler title="'.get_the_title().'" open="no" style="default" icon="plus" anchor="" class=""]'.get_the_content().'[/su_spoiler]');
        $output .= '</div>';

    endwhile;
else :
    $output = wpautop( 'Sorry, no posts were found' );
endif;

echo do_shortcode( '[su_accordion]' . $output . '[/su_accordion]' );

I’ve tested this with a couple of enclosing Shortcodes and got the expected output.