Answer: The iron door is painted (or galvanised) so that air and moisture cannot reach the iron.
Iron rusts when it is in contact with both oxygen and moisture. A coat of paint or oil paint on the door cuts off air and moisture. Iron can also be galvanised (coated with zinc) before the door is made, or rust-proof primer (red oxide) can be applied before painting. The paint must be renewed from time to time.