> Are anti-squatting laws unfair?
Yes. But France doesn't have anti squatting laws (contrary to UK/Netherlands), and for good reasons. Squatting was common practice (even encouraged) after WWII ended to rebuild communities, and there's even "requisition" provisions in the law so that people don't have to squat but the mayor/préfet can seize unused dwellings to house people (although this law is rarely applied).
Now, there are laws against home theft, which is a good thing. Nobody can just come into your residence while you're away for a week and squat it; only far-right media invent (from the void) cases like this but in practice, as a squatter you have exactly 0 legal protection if you do this, and you will be evicted instantly and thrown in jail.
On the other hand, if you squat an abandoned building and make it your primary residence, you have all the "residence" protections any tenant enjoys, including the right to a "fair" (cough cough) trial to determine your fate, the right to the trêve hivernale (evictions are suspended in winter, except in special cases like home theft), as well as the right to a minimum 2-month delay before eviction to find yourself a new accomodation.
I'd be happy to continue elaborating on why your argument is misinformed (and why people usually squat in the big cities not on the countryside) but this comment would be too long. Let me know if you have questions.