It could a faulty switch, sensor, relay, etc. If the a/c or defrost isn't on the compressor should be off. When it's supposed to be on it will cycle on and off. If you made sure that everything is off then there's a malfunction. The only other thing I can think of, which might not apply, is when an a/c system is low on refrigerant the compressor will fast cycle on/off.