First of all you saved the the terms value in a post meta table and not following the wordpress conventional method.
To make it connect with default category with that post you need to modify your save_post
action. Check the modified code.
add_action( 'save_post', 'rudr_save_metaboxdata', 10, 2 );
function rudr_save_metaboxdata( $post_id, $post ) {
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id;
// if post type is different from our selected one, do nothing
if ( $post->post_type == 'post' ) {
if( isset( $_POST['rudr_select2_cat'] ) )
{
wp_set_object_terms($post_id, $_POST['rudr_select2_cat', 'category', false) ;
update_post_meta( $post_id, 'rudr_select2_cat', $_POST['rudr_select2_cat'] );
}
else
delete_post_meta( $post_id, 'rudr_select2_cat' );
if( isset( $_POST['rudr_select2_tags'] ) )
update_post_meta( $post_id, 'rudr_select2_tags', $_POST['rudr_select2_tags'] );
else
delete_post_meta( $post_id, 'rudr_select2_tags' );
}
return $post_id;
}
Please check wp_set_object_terms() for reference.