I think it comes down to personal preference.
Being tanky makes it easier to not die. If what you’re fighting can’t kill you easily, then killing it becomes much easier. I’ll use plantera as an example- you can get over 100 defense without much trouble before fighting her and reducing all her damage by 75 makes it difficult for her to deal meaningful damage to you as long as you’re doing a decent job at dodging, especially when combined with good health regeneration and damage reduction buffs. Against the moon lord, full beetle armor, warding accessories, damage reduction, etc. will mostly nullify the chip damage from the random missiles he fires - you only need to dodge the occasional lasers and eyeballs, and 45%+ damage reduction and like 100 damage reduced means they aren’t crippling if they hit you.
Having high DPS makes it easier to kill things. Enemies will hit hard and you need to be on top of evading attacks to stay alive, but your fights won’t drag on for long.
In both cases, you still need to be able to dodge and avoid damage. Being tanky means that when you get hit (and you will make mistakes and get hit) it’s not as big of a deal. Having high damage means that you’ll be fighting for less time and will have less time to mess up. And there are some attacks that you just can’t tank.
I tend to favor high defense because it makes things less stressful. Don’t need to focus as much and can play more leisurely. An easier fight for a longer length of time instead of a harder fight for a shorter time.