OR your power supply is not good enough to provide more power. Assuming a spike when you need more power, the voltage may decrease enough at the input of the 7805 to make this one unable to provide the stable 5Volt at the output. If the output of the regulator drop under the Brown Out voltage of your PIC, it may badly reset the PIC and send the PC to an unwanted program location. Hence do some strange behaviours.

How about if you use another transformer (let's say wall wart) to drive your PIC?

I'll have a look to your schematic.. maybe i could find something in.