The short answer is because it does work, for some people, some of the time.
The long answer is that I don't know that the "science" is that equivocal about it not "working" - that's a very simplistic take when (a) there's no scientific consensus about the causes/effects of weight loss and gain or indeed about the impact of various degrees of being overweight vs underweight and where to draw the line and (b) what is certain is that everyone is different both biologically and in lifestyle and preferences. It's basically impossible to do really long-term, double-blind, controlled for other factors, evidentially valid studies on nutrition so it's really really hard to achieve the single 'truth' about the most healthy diet, hence why public health advice has swung around so much over the years, fat good, fat bad, fat good etc. It's not just governmental incompetence or influence from the 'food industry' although I'm sure those are factors too.
For many people, if they truly stick to it they will lose weight by reducing calories, and they will be able to maintain weight if they don't then increase calories back up once the 'diet' is over. It may be an inefficient, nutritionally non optimal and/or not enjoyable way of eating, and for some people it may not work at all but for these types of diet are easy to understand (whether it's based on points or simple counting or whatever) and don't require you to cut out food groups etc so can fit into existing lifestyles and eating habits hence their long term popularity. One very important factor in the much-maligned-by-MN WW/SW weight-loss 'clubs' is the element of psychological and social support and accountability, whether it's physically going to a 'group' to be weighed in or online coaching via Noom, this is something that can really help people.
I know dietary advice is ripe 'meme' territory and it's very tempting to believe the latest whatever is the absolute truth and be evangelical about what works for you but in reality I think we're a way off true understanding/ 'silver bullet' of weight loss. I know low-carb is flavour of the month right now and I do see some of the rationale behind it especially the more moderate/ Mediterranean style diets that continue to allow/recommend moderate consumption of whole-grain carbs but it's not in my mind the one and only answer, it doesn't work for everyone nor is it 'perfect' - some low-carb diets for instance encourage really high saturated fat consumption, and I've yet to see the low-carb diet that allows for the recommended daily fibre intake and research (not specially for weight loss) is increasingly showing the importance of dietary fibre for bowel health. Plus it's really hard to low-carb properly (not even keto, just low-ish carb) on a plant-based diet and yet for environmental/planetary reasons that is definitely the direction we should all be heading, that much is clearer in the 'science' than low-carb is, for sure.
Basically I am recommending nuance, empathy and caution when discussing or 'advising' others on dietary matter. The wisest (wo)man is the one who knows (s)he isn't wise, to paraphrase Socrates!