The French, under Napoleon, began doing it so that a record created with a 7 could not be altered to a 1. Given the font here, and careless writing, one can see how similar they could be to begin with.
Supposedly.
Logically, since that really only fixes half the problem (a one could still gain a dash to become a 7) and the true fix, putting the dash on the 1 actually solves the problem fully, it really doesn't make sense. Of course, Napoleon was often a bull-headed idiot whose genius was for the battlefield and policing the ruled over nobility and masses so who can say. But it makes little sense.
What makes more sense is that they simply wanted to distinguish 1's and 7's a little more clearly with no hint of concern for the possibility of record alteration. Just for improved readability. Which it accomplishes, so long as one's 7's look like this font and do not have a little descender from the horizontal bar. When they do, the dash and carelessness can make the 7's and 9's confusing...
Simple as that though, I am sure. Just to improve readability. It was not picked up by the English and certainly not here in the US.
The good reason to do it IN French class, in whatever grade, is the immersion into all things French which helps you feel the French not just learn words, irregular verbs and a (poor) accent! They, um, maybe should serve wine too, by that logic... so, um, maybe your teacher could compromise and not grade down if you make a 7 like you were taught so painfully in kindergarten!