Only an HSA lets you contribute pre-tax dollars, and then spend pre-tax dollars on health care - without paying tax. Roth IRAs are after tax, while Traditional IRAs are taxed on withdrawal (if you spend on non-health care, an HSA also gets taxed on withdrawal).
I'm not sure, but if your point is what I think it is then you're mistaken (albeit a common mistake). Once you've made the contribution you've already achieved the first deduction no matter what you do next. At that point an HSA is just a limited purpose Roth IRA that can only be used for healthcare, so you'd be better off withdrawing and contributing to a Roth IRA (or deciding you'd be better off with another deduction by contributing to a traditional IRA). This doesn't apply if you're already filling all tax advantaged accounts since you'd be better off leaving the money in the tax advantaged HSA than investing in a taxable account.
When we disagree, I'm usually wrong. But I'm quoting the IRS directly, below, so I'm curious how I'm going to be wrong.
https://www.irs.gov/publications/p969#idm139829341537504
(after the list of items)
"Contributions, other than employer contributions, are deductible on the eligible individual’s return whether or not the individual itemizes deductions. Employer contributions aren’t included in income. Distributions from an HSA that are used to pay qualified medical expenses aren’t taxed."
My understanding is this:
An HSA contains pre-tax dollars that can be spent on health care - without being taxed.
If you turn 65 and spend HSA on something else (like a boat), you pay tax on the money spent.
It's entirely possible I misunderstood your meaning in first post, but I've seen enough people argue vehemently for the mistaken thought that it's better to spend on medical expenses out of pocket so as to leave money in an HSA even when the person is not already maxing other accounts that I thought it was worth mentioning on the possibility that that's what you meant. The reason this line of thinking is mistaken is contributing to an HSA and not-spending from an HSA are two different choices.
As the link you posted says first, contributions are deductible, so that's clear evidence that contributions are good idea. But once you've contributed, not spending from an HSA for medical expenses when you can't max out all other tax advantaged accounts is making the decision to have more money in an HSA than in other accounts.
If instead you could take the money out and put in in a Roth IRA then this would be better because money you put in a Roth IRA can be spent on anything without paying tax while money in an HSA can only be spent on medical expenses without paying tax (or you'll need to keep track of receipts for past medical expenses). If I have $100 in an HSA, $100 in cash and a $100 medical expenses am I better off taking out the $100 from the HSA for the medical expense and contributing $100 to a Roth IRA such that I have $0 in an HSA and $100 in Roth or paying for the medical expense with the cash such that I have $100 in the HSA and $0 in Roth?
Similarly, if you could take the money from the HSA to contribute to a traditional IRA (or 401(k)) then you could get a second deduction and the money could later be taken out slightly earlier (59.5 instead of 65, or earlier with other tricks) to be spent on anything while paying tax on the distribution. Again if I have $100 in an HSA, $100 in cash and a $100 medical expenses am I better off taking out the $100 from the HSA for the medical expense and contributing $100 to a traditional IRA such that I have $0 in an HSA, $100 in traditional IRA and get a $100 tax deduction or paying for the medical expense with the cash such that I have $100 in the HSA and $0 in traditional and no additional tax deduction?
Of course, all of this is moot if I can otherwise max out all tax advantaged accounts in which paying medical expenses out of pocket and leaving money in the HSA is almost as good as having more Roth IRA space except that I have to keep track of receipts and gains are only tax free if spent on medical expenses.