Hast du denn den Pic passend konfiguriert?

Der Code ist soweit ich das sehe ok, ein entprellen des tasters ist nicht nötig für diese schaltung...

Ich würde allerding dem pin noch einen pulldownwiderstand verpassen um den sicher auf 0 zu zihen.

ohne das ich das datenblatt genau gelesen habe, aber wenn ich sehe was der port alles kann:
3.4.4.4 RB3/AN9/PGM/C12IN2-
Figure 3-9 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an analog input for the ADC
• Low-voltage In-Circuit Serial Programming enable
pin
• an analog input to Comparator C1 or C2