If your beneficiary is your spouse, then the HSA remains in effect for your spouse.
If the named beneficiary of an HSA is a non-spouse (someone other than the HSA owner’s spouse, or an entity), the HSA ceases to be an HSA as of the date of death, and the HSA assets must be paid out to the non-spouse beneficiary.
The non-spouse beneficiary then has one year to pay any medical expenses that are still owed for you. The remainder of the funds belong to the beneficiary and can be used to pay for your funeral or for anything they chose to use the money for.