It vomited up five bags while rescuers used buoys to keep it afloat in a rescue attempt, while an umbrella was held to protect it from the blazing sun.
A post mortem found 80 pieces of plastic in inside it, weighing eight kilograms.
According to the Thai Marine and Coastal Resources Department, an autopsy revealed that the whale had ingested around 8kg of plastic bags, which were preventing the whale from being able to eat.
The whale's death comes as dozens of cities and companies worldwide are moving to crack down on plastic pollution by banning the use of non-reusable plastic containers, bags and drinking straws.
While pilot whales generally eat squid, the department said it believed the whale mistook the plastic litter for food.
Thailand is one of the world's biggest users of plastic bags, according to The Guardian.
Last month, the Thai government said it was considering a levy on disposable plastic shopping bags.
"If you have 80 plastic bags in your stomach, you die". Kenya a year ago enacted the world's toughest law against plastic bags.
This image shows some of the plastic bags that were found in the stomach of the whale during an autopsy in Songkhla province, in southern Thailand.
"But people haven't really cared to change their behaviour despite being aware of the damage", Thon told the Thomson Reuters Foundation.
Greenpeace's Tara urged the government to quickly enact regulations. "We need to take action now".