24V proximitiy switch, NPN transistor, Arduino interrupt input
The spikes are coming from C4.  Everytime the input switches, C4 passes a short spike to the base of the transistor.

C4 and R5 and R11 form a sort of high pass filter that lets the edges of the signal from the sensor through.

Remove C4 and the spikes should go away.