With the win in the southern Polish city of Bytom on Sunday, Spain clinched the tournament title and advanced to Division I Group B.
Poland, who entered the game with a two-point lead in the standings, needed only a draw in regulation to win the group, state news agency PAP reported.
They would have secured the tournament trophy even with an overtime or shootout loss to Spain, according to the Polish Ice Hockey Federation (PZHL).
Instead, Poland lost in regulation, finished second, and will remain in Division II Group A for another season, the PZHL said.
"It is us who were supposed to be happy and celebrating today," said Poland captain Karolina Późniewska.
"I don’t know why it all didn’t work … We tried. The whole team left their hearts on the ice; we gave it our all. But it wasn't enough,” she added, with tears in her eyes.
Poland had been relegated from Division I Group B last year after finishing last in the tournament in Riga, Latvia.
"The fact that we are staying in the lower division may be even more painful for us than last year's relegation," Późniewska reflected. "We trained hard for this tournament all year long, and we were supposed to be celebrating now."
Head coach Arkadiusz Sobecki said the team expected a tough game against Spain but had hoped to come out on top.
"We knew it would be a difficult match and that it would decide the outcome of the tournament,” Sobecki said. "But the Spaniards made things very difficult for us early on, and we couldn’t stage a comeback."
Poland won their four other games in the tournament, defeating Mexico 8-2, Chinese Taipei 9-2, Iceland 2-0 and North Korea 9-0.
Mexico finished last and were relegated to a lower division.
The Polish team is ranked 20th in the world by the International Ice Hockey Federation (IIHF).
The Division II Group A tournament was played in Poland's Bytom from April 7 to 13.
(gs)
Source: IAR, PAP, polskieradio24.pl