"We can not have countries that benefit hugely from EU solidarity and claim national self-interest when it comes to the issue of migrants," he said at a press conference in Paris alongside Spain's new Prime Minister Pedro Sanchez.
"I am in favour of sanctions being imposed in the event of no cooperation," he said.
On the eve of a mini-summit about the divisive migration issue, the two leaders also declared support for the creation of closed reception centres where migrants would be held while their asylum claims are considered.
The centres would be set up near to where migrants often arrive first in Europe.
"Once on European soil, we are in favour of setting up closed centres in accordance with the UNHCR (United Nations High Commissioner for Refugees)... so that each country takes people who are entitled to asylum in an organised way," Macron said.
There are currently no closed migrant centres where applications are processed, with the exception of a few cases in Greece and Italy managed by the UNHCR.
For migrants not entitled to asylum, they should be returned directly to their country of origin and not via other countries, Macron added.