why do we place pullups on unconnected pins
To summarize the above, and to clarify some of my experiences:
-- The data sheet recommendation should be used, if available.
-- Unused input ports of most devices should not be left floating, but connected to an "inactive" state. If active-high, you should ground, if active-low, you should pull them up.
-- If in doubt (and if you can afford due to space, etc) - use a resistor to pull up or down. It may be safer, and give you an option to change the circuit without any dramatic things such as PWB re-design, if you regret/find otherwise during a test. For most modern CMOS devices there is a negligible DC current present, so the resistor may be quite large, for example in tens of kilo-ohms range.
-- Unused output pins should generally be left floating.
-- The initial state of programmable pins is essential: If an I/O pin is initially input, you should not let it float, if initially an output, do not hard ground or connect to the supply. A resistor may be here the most fail-safe way to pull "weakly" during floating times, while allowing the output to work normally...
-- In case of pull-up, be aware of the input voltage range, and use a correct voltage to pull it up.
br ted