What’s the purpose of an HSA?

Saves you from paying income tax on money ultimately spent on healthcare.

In practice it basically just reduces your taxable income, which is good.