There are different kinds of masters in France. But this is not what the M1/M2 distinction is about. M1 and M2 literally mean "first year of master" and "second year of master". They are not degrees, they are years, like "sophomore" or "senior" in the US. The master's degree is the combination of these two years. You cannot apply for M2 if you have not completed the equivalent of M1. What qualifies may depend on the university, but US undergrad certainly does not, as it would be the equivalent of a license degree (L3, third year of license - see how it works?), even if you did it in four years.
The different kinds of masters that exist are teaching, professional, and research. If you want to work in academia, you probably need a PhD, and to apply for a PhD in France, they usually ask for the equivalent of a research master's degree. A professional master prepares you to work right after getting the degree, while a teaching master prepares you to be professor in middle/high school.
So research M2 is the one you need to do. It will involve taking classes but also an "internship" during which you will have to write a "memoir", kind of like a mini PhD thesis. In most fields, the teaching and research master's degrees are the same in the first year and split in the second year. Thus if you only have undergrad education, then all you can apply to is a common M1 year in the field you want, and next year you will be able to apply for a research M2 year.
Perhaps to drive the point home: you typically need to complete the M2 to apply to a PhD. But you need to complete the M1 to apply to the M2. So the question cannot be "which is the one for academia". It would be like asking whether 11th grade or 12th grade is the one you need to complete to enter a college. You need to do both.