Maybe the spike is from ac power, but UPS didn't filter it, on line UPS can filter spikes, what about a line-interactive apc smart?
The model you have is rated at 274 joules of surge clamping per its spec sheet. If it received a spike in excess of that amount, it wouldn't still be functioning. Nor would any other electronic devices in your home that were plugged in at that time. (most spikes last under ten microseconds, to exceed 274J in that time period you're looking at minimum a spike of several thousand volts, possibly tens of thousands)
An on-line UPS is much better at handling sags in voltage, not necessarily better at suppressing spikes. A larger UPS is generally better at handling larger spikes. 1000VA models are usually rated 300-400J, 1500VA models are generally in the 400-600J range.
How far do you want to go down this rabbit hole?
Let's assume it was a spike that caused the HDD to fail:
Ok, the UPS didn't stop the spike, so it should be replaced.
The PSU didn't stop it either, so it also needs to be replaced.
Every device in your computer was connected to that power supply, and they were all subjected to the same spike. Everything is suspect and needs to be replaced. If a big enough spike came in that it damaged one HDD, you can't trust any other components that were subjected to that spike.
If you really want to get a new UPS, it's not a bad idea. There are better models than the one you have now. However, I am still sticking to my position that it's extremely unlikely that your HDD failure was caused by a power problem.