Valls, who quit President Francois Hollande's government last month to stand as a candidate in the primary, was accused of only admitting a few thousand migrants during his time in office.
“I get the feeling that the French people were much more generous than their leaders,” said Vincent Peillon, a former education minister who is considered an outsider in the contest.
Another candidate, Benoit Hamon, told Valls that France had a duty to “show its values, especially when it comes to migrants and refugees”.
Valls hit back that “an open-ended policy (of accepting migrants) is not possible”.
“I think France was right to follow this policy and history has proved us right,” he added.
The influx of more than one million asylum seekers — mostly from war-torn Syria — into the European Union in 2015 triggered the worst refugee and migrant crisis on the continent since World War II.
France's EU heavyweight neighbour Germany opened its doors, bringing in 890,000 asylum seekers in that year alone and fueling debate about why other EU states could not take more.
Socialists face battle
The French political attacks showed once again that a week ahead of the first round of voting on January 22 followed by a runoff on January 29, Spanish-born Valls' campaign is struggling to take off.
A poll of TV viewers after the debate had Arnaud Montebourg, who served as economy minister in Hollande's government before quitting, as the most convincing of the seven candidates. He polled 29 percent, ahead of 26 percent for Valls.
With Hollande ruling out a bid to retain the presidency after a torrid five years in power dogged by unemployment and terror attacks, the Socialists are seeking a presidential candidate who can at least salvage some pride for the party.
Current projections show the Socialist candidate, whoever it is, crashing out in the first round of the election, as voters across Europe lean to the right or opt for anti-establishment and anti immigration parties like Marine Le Pen's National Front.
The majority of polls currently predict that conservative candidate Francois Fillon will face Le Pen in the decisive second round on May 7, although after Donald Trump's win in the United States and the victory of Brexit in Britain, no-one is taking anything for granted.
Looming large over the leftwing primary are Hollande's star former economy minister Emmanuel Macron and Communist-backed firebrand Jean-Luc Melenchon, both of whom are running for president outside of the primary system.
Macron, a 39-year-old former Rothschild banker who positions himself as “neither of the right or the left”, drew a crowd of several thousand supporters when he held a rally in the northern city of Lille on Saturday.