Hello
To solve this problem you can do one of two options I am going to mention:
1. If your using PORTB, then use its internal pullups, and connect your buttons between PORTB inputs and ground, so that when a button is pressed, you will have that porb pin connected to ground.
2. If you are not using portb, then use external pull up resistors, say 4.7KΩ, and connect the buttons as I mentioned in the 1st option.
The reason for that isas follows:
Capacitors on the supply rail will try to overcome spikes as possible, so that what really occurs is that these caps will pass the high spikes voltages to GND line which causes instability of the PICs operation. Believe or not, passing the spike voltages to GND while port pins are pulled down, will virtually disturb GND potential for a very short periode of time, but so efficient to cause the port pins to saense a HIGH, as if a button is pressed !!
Think about it ,as you are playing with at least 1usec time base
Thats why its recommended to pull up port pins, and connect the btton between port pin and GND.
Good luck