First, try PortB instead of PortA and see if it works for you.

Then go look in the DATASHEET for your PIC to discover how to switch OFF the ADC's (Analogue to Digital Converters) and the Comparators before you play with PortA again.

Like I keep saying (several times a week), nobody reads Datasheets.