A few things could be causing this, so lets get started.
Kill switch: Make sure it is in the run position. Sometimes they get corroded and fail. If you suspect your kill switch has failed, cut the two wires going to the switch, and either twist them together or keep them apart. Try it in both positions.
You will also want to make sure you are in neutral with the kickstand up and the clutch pulled in. Some bikes have special switches to prevent you from starting the bike in gear or with the clutch out. Sometimes, these switches can fail. You can bypass them in the same way that you can bypass the kill switch. Here's a video on how to find these switches and what they do: