What is the way to detect sd card insertion/removal?
SD Card detection is typically done by a mechanical switch that is built right into the SD Card socket. It opens and closes when the card is inserted and removed. You will have to investigate how this switch is hooked up in your hardware and test that this works correctly up to the PIC32 pin before you even begin to think about software issues. 

Testing the hardware should be as simple as looking at the signal going to the PIC32 pin using a scope probe or multi-meter in volts measure mode. With the PIC32 board powered monitor if there are changes of state in the signal as a card is inserted or removed. If you do not see this working then the switch in the socket is not properly connected. It is typical that one side of these switches is connected to GND. The other side has a pullup resistor to +3.3V and also connects to the PIC32 pin. If working correctly you should see it changing between 3.3V and GND.

Once you have verified the hardware connection it is time to investigate the PIC32 software aspect. The particular pin connection needs to be a general purpose input port pin on the microprocessor. Then that port pin needs to be properly configured to be acting as a digital input pin. If not properly configured then there will be no joy in reading in the SD Card status signal.