Why does the 741 op-amp saturate to the top rail when inputs both grounded?
You're also not taking into account the input offset voltage. This is a factor present in all non-ideal op-amps, and can be modelled as such:

The 741 series of op-amp may require you to &quot;null&quot; the input offset voltage, so even if you apply an identical voltage to both terminals, without any feedback or nulling on the terminals, I'd expect it to rail in one direction or the other.
Remember, op-amps have very very high open-loop gain (106dB in this case or about 200,000). The worst case input offset voltage for this op-amp is 6mV, or even 7.5mV across the whole temperature range. This offset voltage will be amplified by the open-loop gain of the amplifier, yielding an output voltage of 1200V! Obviously the op-amp cannot output this, so it simply rails in one direction, or the other.
As a general rule, unless you're using them as comparators, op-amps aren't usually used in open-loop configurations. The high open-loop gain serves the purpose of linearizing the closed-loop gain through negative feedback (but this is probably above the scope of this answer).
image credit:
https://www.allaboutcircuits.com/textbook/semiconductors/chpt-8/op-amp-practical-considerations/