apache: One thing I like to say about bettas is that they're undemanding fish but for a long healthy life they absolutely need warm, steady temperatures. They are very much tropical fish and they quickly succumb to low temps and temperature changes.
It depends on how big you aquarium is, but if it's 2 - 5 gallons, a submerisable 25 watt heater should do the trick. You can find some at Petsmart or Thatfishplace.com for about 10 bucks.
Bettas like a temperature from 74 - 80. I keep my tank about 78. Even the lower end of that is just fine, however, but the temperature has to remain pretty steady, not moving more than a couple of degrees either way.
Keep in mind that if your lighting is using an incandescent bulb that will heat up the aquarium and make it virtually impossible to keep a steady temp.
I know they keep the bettas in those dinky let cups at room temp, but the petstores don't have as many temperature fluctuations as a normal home does. Plus the fish aren't meant to be in that situation at all, let alone an extended period of time. Water is usually a few degrees cooler than the the ambient air, so even if you're at 74 in the house, the water's colder, plus every errant sunbeam or breeze can fool with the temperature.
The fish could have been already in a bad shape (especially if they have been languishing in the store for days - if I wanted to rescue a betta from them I would do it the day they get in new fish), but my betta's from Petco and he's currently wrapped around the heater resting up from a full day of flaring at mirrors and working on his nest. You might want to get your fish from a new place but the heater's a pretty important part of the equation. Even if the fish were weak when you got them, the temperature issue could have finished them off.
Again, if you got something like soap in there it would be nearly impossible to tell and would explain the rapid loss of fish. You might want to thoroughly clean everything in the tank and the tank itself before getting another one.