In America (and elsewhere?) we have a tradition of trick-or-treating where on Halloween or the night before kids go around the neighborhood in a costume, knock on doors, and get candy. It’s a lot of fun.
But I was well into adulthood before I learned that not all places have kids tell jokes before they get candy. Apparently it’s only the city I grew up in that they do that! Not even neighboring cities do it.
In that case I’m guessing a certain religious group decided that in addition to the devi, tricks are dangerous, and a nice joke is safer.