The conventional 60 or 100W bulb ( a.k.a. Edison bulb) has a coiled tungsten filament. When it is operated from a wall dimmer switch using a triac. the surge currents are high at firing, When Dim, the average power is 10% but the current spikes from being cool may be 5x normal peak current. When this repeats at a 60 or 120 Hz rate or 50/100Hz it makes the sound like a faint pinging spring at that rate due to the forces not being sinusoidal but rather pulsed from a fast rising edge.
Ref: **broken link removed** If you see the common mode choke coil suggest for this dimmer, you should find your UPS already has one. Possibly it has a resonance with a harmonic of the line frequency.
What I dont understand is why your water heater would trigger this resonance, as it should have fairly linear sinusoidal current from a linear resistance and stead AC voltage.
Anyways, I can only make wild guesses without some test results to isolate the waveform and sound. Good luck.