After the game, Halladay acknowledged he has a sore right shoulder. He said he will undergo tests this week in Los Angeles and be examined by Dr. Lewis Yocum.
The right-hander did not take questions from reporters after his second poor outing in a row.
Kevin Slowey (1-2) pitched seven shutout innings for his first win since September 2010. He allowed two hits while striking out seven and walking two.
Slowey had been winless in 22 major league appearances, including 15 starts. His previous victory came on Sept. 18, 2010, as a starter for the Minnesota Twins.
Justin Ruggiano homered twice off Philadelphia relievers, and rookie Marcell Ozuna went 3 for 4 with two doubles and three RBIs for the Marlins, who set a season high for runs. The output by the league's worst offense was surprising - especially against Halladay (2-4).
The two-time Cy Young Award winner and eight-time All-Star had his worst start since his rookie season. He left after giving up nine runs on four hits, four walks and two hit batters in 2 1-3 innings. Halladay, whose ERA ballooned to 8.65, has given up at least five earned runs in four of his seven starts this season.
Meanwhile, the Phillies' hitters continued to have their own problems. A night after managing only one hit off 20-year-old rookie Jose Fernandez in a 2-0 loss, Philadelphia had just four against Slowey and relievers A.J. Ramos and Jon Rauch.
The Marlins' five runs in the first inning off Halladay were more support than they had given Slowey in 37 2-3 innings entering Sunday. The right-hander had pitched well this season, entering with a 2.15 ERA, but had received just four runs of support from Miami's offense, which entered last in the majors in runs (84) and batting average (.226).
Halladay, who has the most complete games (67) and shutouts (20) of any active pitcher, had 35 wins since Slowey's last one. But he hasn't resembled that pitcher for most of this season. Following Tuesday's poor outing in which he allowed eight runs on nine hits in 3 2-3 innings of a 14-2 loss to Cleveland, Halladay continued the troubling trend against Miami.
The Phillies have been outscored 28-4 in his last two starts.
Halladay helped the Marlins in the first with three walks and a hit batter. With the bases loaded, Ozuna put Miami on the board with a two-run double. Umpires reviewed the play to see if it was a home run but upheld the call on the field that the ball hit the top of the wall. After Halladay walked Greg Dobbs to load the bases again, Hechavarria, who entered batting .169, cleared them with a triple to right.
After a 1-2-3 second inning that featured two strikeouts, Halladay's struggles resumed in the third. The right-hander opened the inning by hitting Ruggiano with a pitch for the second time in the game. It was the fourth hit batter of the season for Halladay, who plunked just five per season over the last four years in an average of 220 innings.
A walk to Ozuna and a single by Dobbs loaded the bases with nobody out. After Miguel Olivo struck out, Hechavarria hit a grand slam just over the wall in right to give Florida a 9-0 lead and prompt Philadelphia manager Charlie Manuel to lift Halladay.
He exited to a mixture of boos and cheers, though the majority of the crowd politely applauded. The nine earned runs were the second-most of his career, topped only by the 11 he gave up as a rookie with Toronto in a 17-1 loss to the Angels on April 29, 1999.
The homer by Hechavarria was first ruled a double but umpires reversed the call after reviewing the replay.