Check the wires coming from the switch. You've got a bad connection somewhere, as the switch has to make contact with a ground to kill the ignition. It may simply be a wire that came loose while riding, or your switch contacts themselves could have jarred loose.
If you don't see any detached wires, unhook the two black kill wires coming from the handlebar switch and put a continuity tester or ohm meter between them. You should have no continuity (an open circuit) with the switch in the 'ON' position. Flip the switch, and there should be continuity (a closed (or 'complete') circuit) with the switch in the 'OFF' position.
If you have continuity, the switch is working and the problem lies elsewhere. If you get no or intermittent continuity, it's time to disassemble the handlebar switch to see what went wrong inside it...