There are food Nazis everywhere. When I was a bone thin teenager total strangers used to come up to me and tell me I should eat more, even lecture me about it. And yet if I sat at a park and ate a cream cake (which was normal, I had an enormous appetite at that age and all the will in the world to sate it... I hated being so thin), more often than not someone walking past would say "don't eat that, you'll get fat".
If I'd been within earshot and realised what this guy was saying to you as a stranger I probably would have laid into him myself. A high ranking nun at my school (Deputy Head) took it on herself to diagnose me with anorexia - caused me a world of trouble - some people should really mind their own business.
If it happens again, tell the next person to go #%¥* themself. And remember that thin people can get this crap too... so please don't give the fact that he targeted you a second thought. He sounds like a moral bully. You don't 'need' to cook your food either, or use spices, or make it delicious in any way, in fact, you don't 'need' the great majority of the things that make life worth living.