Well, one carrot for Spain was the assistance it received during the last financial crisis[0], and France probably likes being able to project its influence onto neighbouring countries through its position in the EU.
Less reductively, I think that a major benefit of a political union is that it gives some degree of democratic legitimacy to decisions made about difficult region-wide issues like trade policy, consumer protection, immigration, the environment, and anti-trust law, to name but a few.
All of those matters could in theory be settled via multi-lateral treaties, but they would probably be hard to reach flexible compromises over while still being overseen by representatives voted for by the public with a mandate for deciding on those supranational issues.
[0] https://en.wikipedia.org/wiki/European_debt_crisis#Spain