it's because you PIC input is floating when there's no 5volts from PIR at the input. You need to tie it to ground with resistor. This way PIC will see high level and low level(produce by resistor).