In digital circuits, more energy is consumed during a transition from high to low, or from low to high than when a gate sits still. If a gate is constant low or constant high, the consumed energy is very, very small.
If you let an input floating, then the electric hum from the surroundings (for example the mains hum, or some parasitic induced voltage from a nearby radio station, etc) those weak parasitic signals might make a floating input to capture the electric noise and flip repeatedly between high and low. With each flip, energy is wasted for no reason.
Therefore, you can either pull-up or pull-down the input gate, so to permanently fix it's input as either high or low, so it won't flip like crazy from the surrounding parasitic. Or, you can set that pin as an output, thus making that gate sensitive to your software only, and insensitive to surrounding parasitic fields.