I'm so sorry to hear!! Keep in mind it could have been a sick fish when you bought him. Pet store bettas are notorious for up and dying for no reason on new owners. He probably had some internal problem, that is not un common in pet store bettas. I'm so sorry :(
I would wash the tank out with a very very mild bleach/water solution. Make sure to rinse it well!! And you can even air dry it outside for a few days. That would make it safe for another betta, if and when you feel ready.