I think a lot of this depends on what, when and why you are treating.
If you're giving them treats to make them "happy", you're not really. You're doing it to make YOU happy. Certainly they're excited for food, maybe even excited for unique food, but....
I get the same reaction when I throw a handful of dirt, oyster shell, scratch or grit into my chicken pen at a different time than feeding time. It's not something that happens often and even if I throw something mostly inedible (like dirt or wood chips or leaves in) I get the same reaction (though usually for a shorter time periodas they figure out it's not food). Similarly when I feed my dogs for kibble they literally jump and bark for joy. One of them has this silly backwards dance they do when I am holding the food bowl. They beg for food when it's bananas (which they love) or when it's spinach (which they hate). So it's not like they get the same thing out a varied diet that we do - it's mostly the excitement for the moment itself. A few treats may provoke a stronger reaction, but mostly they're just excited about existing and food.
So if you give them treats to make them happy, or because the beg, that's really all about you not them. But if you give them treats to do a task - get in the pen, do a trick, distract them from picking on another member of the group or to alleviate behavioral problems from being bored - this serves a purpose and is a good why.
When is also important and ties into why a little. If you give treats "just because" every day, guess what, it becomes as routine and normal as their feed and most chickens start to react to it the same as chicken feed. Also, if you give treats before regular food, this can be a real problem as they might not eat enough of a nutrient to be healthy or even lay eggs well.
And then comes what. Mealworms and sunflower seeds have a lot of protein and fat for example. This is like a big juicy hamburger - it's delicious but is it really a good idea to eat that every day? Maybe not, but a snack of it during moult when they are growing in feathers, or to a sick chicken that's loosing weight, or for chickens just starting to lay would be appropriate. A melon or melon rind is mostly water, which means it's a terrible snack in the winter when it will freeze fast and cool the chickens, but beneficial in the summer when they need extra moisture anyhow. A little bit of cracked corn or scratch on the coop floor in the evening in winter can give them extra heat from their digestion over night. What you feed is when treats become most beneficial to the birds.
Of course, chickens in our great grandparents days ate differently, they picked seeds from cow pats and they ate the corn the owners tossed out. They also were much smaller and layed many fewer eggs. If you'd like to keep your chickens that way, there are some old landrace-style breeds like game birds or jaerhons that would meet those expectations. With greater production and size comes greater nutritional needs.
So treats are fine, they serve a purpose and I certainly feed them, they can be beneficial to chickens and a good boredum buster, but they are pointless as an every day snack for no reason.