The answer to 'why is my dimmer switch sparking' is that a sparking dimmer switch is usually a sign of an electrical issue that requires professional repair. Common causes include a faulty dimmer, loose wiring, or overloaded circuits. Sparking can be dangerous and indicates a potential fire hazard, so it's important to address the problem right away.
If your dimmer switch is sparking, stop using it immediately and turn off power to the circuit at the breaker. Do not attempt to fix it yourself unless you are a qualified electrician. Call a licensed electrical contractor to inspect the switch, diagnose the problem, and make any necessary repairs. They can ensure the issue is resolved safely and up to electrical code.