The serial monitor sends text, not binary data. When you type in "0x0" the sketch actually receives three characters '0' (ascii code 0x30), 'x' (ascii code 0x78) and '0' (ascii code 0x30). Depending on the serial monitor settings that may also be followed by CR (ascii code 0x0x0D) and/or NL (ascii code 0x0A).
If you want to be able to type in "0" or "1" in the serial monitor, you can detect those by comparing the received byte with '0' or '1' characters. For example:
if(incomingByte=='0')