I recommend talking to your son’s teacher and confirming what was actually said. Children do not always understand nuance, and your son may have conflated a prudential caution with an admonition against sin. If the teacher told the class that it is “not nice” or “not a good thing to do” to wear a scary Halloween costume, that is not the same thing as saying that wearing a scary Halloween costume is a “sin.” If this is the case, then the teacher should be informed that the children have misunderstood and need clarification.
If the teacher did say that wearing a “scary” Halloween costume is a “sin,” then and only then do you have a problem. “Scary” as an adjective for costuming is so entirely subjective a term that it could encompass everything from a skeleton costume to an axe murderer costume. It should go without saying that there is a huge difference in a child dressing up as a skeleton and a child dressing up as an axe murderer. You might recommend to the teacher that something so entirely subjective should not be classified as “sin” but should be confined to the realm of prudence (i.e., Is it a “good idea” to wear a particular costume on a particular occasion?). If the teacher is unresponsive, go to the director of religious education. CCD teachers should not be fostering false scruples in their students.
All that said, there is also the question of how you deal with your son. Flatly contradicting his teacher undermines her authority, and that should not be done except in serious circumstances. I recommend telling him that some people are very uncomfortable with scary costumes on Halloween, that his teacher is obviously one of these people, and that this year you and he will find him a non-scary costume that would be acceptable to his teacher. In future years, once he is out of this class and better able to understand the situation, you can explain that his teacher evidently also is excessively scrupulous.