Why does air come out when I remove the pump from the main valve?

Your valve is in the deflate position when the plunger is pushed in. Push the plunger with your finger and twist until it pops up. Refer to your manual for proper inflation and deflation techniques.