When you voluntarily lose (to make someone feel better, to end an argument), and then the situation gets even worse. So, what you thought you would gain by losing on purpose is lost anyway.
It’s a colloquial equivalent to paving the road to
hell with good intentions.
(A lot of
people writing their definitions for this are trying to make logic out of the phrasing but weren’t around when this phrase was more
popular, leading to incorrect definitions.)