Are pins 2 and 3 supposed to be connected?
An input that isn't connected to anything "floats". It will give you unpredictable values. It could be influenced by nearby pins. That is probably what you are seeing. (The metal traces for the 2 pins probably run next to each other on the Arduino's PC board.)

You should either tie an input to ground with a resistor, tie it to +5V with a resistor, or use INPUT_PULLUP mode, which ties it to an internal pull-up resistor. Any of those things will prevent the input from "bouncing around" and giving unpredictable results.

(Note that using a pull-up resistor, either internal or external, has the result of inverting the logic state you get from that input (you get HIGH when the input is not connected to ground, and LOW when it is connected to ground.)