remove add to cart for free (0 $) product woocommerce

Please try to add following code into your theme functions.php file

function remove_add_to_cart_option( $purchasable, $product ){
    if( $product->get_price() == 0 )
        $purchasable = false;
    return $purchasable;
}
add_filter( 'woocommerce_is_purchasable', 'remove_add_to_cart_option', 10, 2 );

Replace below function instead of above and check again

 /*
 * Override via functions.php
 **/
 if (!function_exists('woocommerce_template_loop_add_to_cart')) {
 function woocommerce_template_loop_add_to_cart() {
    global $product;
    if ( ! $product->is_in_stock() || ! $product->is_purchasable() ) return;
    woocommerce_get_template('loop/add-to-cart.php');
  }
}

Let me know if any query.

Hope it will help you !