Beats allows Apple to sell "AirPods" to consumer demographics that either can't or won't spend the higher-end prices that AirPods are sold at, all while maintaining the premium and Apple-exclusive status of the AirPods brand.
Beats is basically "AirPods SE" -Budget-friendly, lower-quality and partly outdated hardware, repackaged to appear exciting and luxurious, paired with decent smartphone OS integration and a sparse selection of features that are usually only found in actual AirPods.
Scrutinizing the actual hardware, Beats are typically very low value/$ for the consumer, yes. But they still sells in big numbers because of low end-consumer prices, generating high profit margins for Apple.
Killing off products that sell as well as Beats do would be a mistake unless you hate profits.