Hi!
Have you set France and Spain as targeted country in Google Search Console?
By doing it Google will try to have your Franch website in France and Spanish in Spain SERP.
Along with rel=hreflang, if you have office or local number for France, it will help.
Auto redirecting the visitors based on IP is not recommended by Google.
Have you provided a link to Spanish page from French website and another way? It will help visitors to select the language.
Hope it helps.
Regards,
Bhavesh