Besides matching the input impedance to null the offset voltage caused by the input bias current offsetcurrents, another reason is to limit currentslimit currents in the case of an input overvoltage condition.
In the case of overvoltage (input beyond power rails) most op amps can tolerate a few mA of input current through their internal rail clamping diodes without damage. A resistor of, e.g., 10 kΩ allows the input voltage to exceed the rails by some 10s of volts.
Although some op amps do contain some serial input resistance, this is usually kept rather small for noise reasons. As a result, external current limiting is almost always necessary when inputs can leave the range between the supply rails.