Originally Posted by joed
Find the door bell transformer. That is where you need to fix the wiring issue. It is likely attached to the fixture box where that switch has control.
It may also be connected to a random splice box somewhere in the attic or basement. Whoever installed the doorbell transformer may have saw the splice box and installed the transformer there not knowing that the circuit is switched.
It's easy to find the transformer, it'll be sticking out of the side of an electrical box.