You should really look at studies on how happy employees are much more productive than unhappy ones. And the trend continues way above the bare minimum of not being miserable.
there's usually more than two priorities. and i agree with you that a team's wellbeing is important. it should be up there in priorities.
i'm just pointing out that a team that accepts being <some imaginary figure that's not 100% like 70% or 80%> happy, focussing on the software as more important than their own happiness might do better than a team who are trying to focus on their happiness at the same level of priority as the quality of the software.