+1 to HFM.
The footswitch on the ME50B is set up so that every time the switch closes (makes electrical contact) it performs an action. If you have a momentary switch, the switch is closed only when it is pressed. If you have a latching switch, the switch closes when you press it, then stays closed until you press it again. When you press it again, it opens.
So what is likely happening is you press the latching switch, and it closes, turning on your compressor. Then you press the switch again, opening the circuit, but opening the circuit doesn't command any action. Then when you press it again, it closes again, turning off your compressor.
With a momentary switch (sometimes called non-latching switch), it closes when you step on it, opens when you release it. Instead of having to stomp twice to get the close-open action, you only need to stomp once. If you have a homemade job, you need to replace the switch with a momentary contact or non latching footswitch. If yours is a store-bought number, you may want to look into
this or
this.