This is standard woocommerce functionality, it shows “out of stock” products on the shop page, in the woocommerce widgets, everywhere.
Only on the product single is “Out of stock” shown instead of an “Add to cart”.
- Go to Woocommerce → Settings and click the Products tab
- Click the Inventory link at the top
- Check the Out Of Stock Visibility option to hide out of stock items
