Digital input ports of the dsPIC30F4011/4013 not working on the dsPICDEM 2 Development Board
The PORTB pins have alternate functions as analog inputs. You need to configure the ADPCFG register for digital pins (bits set to 1) as the reset value is all zeros (analog pins). Refer to the dsPIC30F Family Reference Manual page 18-9.

Note also that to use the pins as digital inputs, set the desired TRISBbits to 1 (inputs). Then you need to read from PORTBbits, not from LATBbits which is a latch for output operations.