Confusion using digitalRead and internal pull up resistors

The behavior of the pins seems different whether I write the code as:

Pins are INPUT and LOW by default.

When you set the mode, the pin is turned off, if it was on. Then, turning the pin back on activates the pullup resistor.

So, your two blocks of code do not produce the same behavior. Only the first is actually correct, if the objective is to enable the pullup resistor.

The second block of code is turning the input pins on, then setting them as input again, with the result that they are turned off. The pullup resistors end up being turned off.

Without the pullup resistors, or external resistors, the pins float. Floating pins are not a good thing.