The answer is a bit deeper. Ports 1, 2, & 3 have output structures which are refered to as quasi-bidirectional ports. When the port data register contains a zero the N-channel output transistor can sink several milliamps of current. When the port data register contains a one there is only a weak pullup which can supply only a few tens of microamps. In this case the "output" can be overridden by another strong pulldown.
In order to use the alternate functions of port 3 you must write 1's to the bits which will be using the alternate function. The alternate function of port 2 is the high order address bits (A8-A15) which are used to access external memory and peripherals. Initializing P2 to 0xFF would be a clue that external memory or peripherals are involved.
Lastly, never forget that port 0 has "open drain" outputs. You must provide an external pullup, except when port 0 is the multiplexed address/data bus.
Is all of that just about as clear as mud in the street?