Why does water heater closet door jump open?
With a gas water heater there could be whoosh of air pressure change just as the heater comes on to heat the water. That could in turn create a suction and then a release as the air pressure re-equalizes that makes the door come open.

Mitigation of the problem may be as simple as putting a catch on the door that has a stronger detent. Or if possible install a conventional door knob and latch . . . although that will be harder if the door is only thin 3/4" or 7/8" door.

Another possibility is that the exhaust vent for the heater is not shrouded correctly above your roof line and is allowing a down draft into the closet that pushes the door open.