Why is this jquery / java script code not working in mobile / in devices?

It’s not showing because the .insertAfter() and .show() functions are called on resize events only, while mobile devices do not resize. They already load the page with their mobile sized. Just make sure you also run the code on the ready event:

<script type="text/javascript">
/* to show back the left side bar back when the LEFT side bar is moved next/below to the center/content */
    function responsive_sidebar() {
        if ( jQuery(window).width() < 1018 ) {            
            jQuery('.tm_left').insertAfter(".tm_center");
            jQuery('.tm_left').show();
        } else {
            jQuery('.tm_left').insertBefore(".tm_center");
        }
    }

    jQuery(document).ready(function() {
        responsive_sidebar();

        $(window).resize( responsive_sidebar ); 
    });  
</script>

Note that I put the code into a function, just so you have fewer lines of code/