The storm, which had left 220,000 people in the Tarragona region without electricity on Tuesday, began to shift away on Wednesday, but some north-eastern and Balearic areas remained on orange alert.
A homeless woman froze to death near Valencia, according to a municipal official. A farmer in Almería died after becoming trapped in a greenhouse during a hailstorm and another man was found dead in a flooded area a few miles inland from Benidorm. A man in Spanish city Ávila died when roof tiles hit him in the head after being broken off a nearby home, Reuters reported.
The storm arrived on Sunday, bringing heavy snow, rain, and gale-force winds to Spain before moving into southern France by Tuesday.
Rescue officials said the missing included a 25-year-old Briton on the island of Ibiza and a man who fell into the Mediterranean as he tried to moor his boat in Palamos port.
The Ebro Delta, halfway between Barcelona and Valencia, was hit by a storm surge.
One French forecaster was quoted by local media as saying the storm was the worst in the region since 1982.
"We can't remember anything similar ever happening", local mayor Lluis Soler told Cadena SER radio.
Prime Minister Pedro Sanchez tweeted his "support and solidarity for the families of the victims of Storm Gloria and those suffering its fatal consequences".
Emergency services have responded to some 322 Storm Gloria-related incidents across the Balearic Islands, ranging from fallen trees to landslides and flooding, with gusts reaching up to 84kph (52mph) at times.