Looking at one side of an equation is never going to tell you whether something is worthwhile. You have to look at all sides.
It's not at all clear that lockdowns were worth it, but I wouldn't say it's obvious in either direction.
Rather, we have been conducting a grand experiment on society, far different than our reaction to other similar diseases in which there was no society-wide lockdown. In fact over several millennia spent dealing with plagues, we have never conducted a society-wide lockdown as a response to an outbreak before now.
This is the first time we've done it, and the full costs of this experiment are not yet known - and they wont be understood for decades to come.
Lockdowns were (and are) worth it.