The answer to 'why is my switch sparking' is that a sparking switch is a sign of an electrical problem that requires immediate attention. Switches can spark due to loose connections, outdated wiring, water damage, or other issues that create arcing and short circuits.
Sparking switches are a fire hazard and should never be ignored. If you notice any sparks, flickering, or burning smells coming from a light switch or electrical outlet, shut off power to that circuit immediately and do not use the switch until the problem is resolved. Attempting to use a sparking switch can lead to further damage or even start an electrical fire.