You have a faulty door switch. There are usually three of them. You could use an ohm meter to find the bad one but since they are so cheap I usually just replace them all since the others could be about ready to fail also.
A NOTE OF CAUTION. The high voltage capacitor in a microwave can store enough current to kill a person. Make sure you have discharged it before attempting any repairs. If you are not sure how to do this, take the microwave to a qualified technician
Philtech Electronics, November 2006