You are right in the sense the evolutionary biology doesn't try to explain the origin of life as it is not within its scope. Other fields of biology investigate the question of origin of life (abiogenesis).
Now, there is a very important difference between spontaneous generation and evolution. Life originated at some point and the through repetitive speciation events, created the whole diversity of species existing on earth. You could say that what really happens is that there was one spontaneous creation of life (although there is more a continuum from non-living to living things than a sudden switch from non-living to living) out of non-living things.
The main fallacy of spontaneous generation is that under the spontaneous-generation-conceptualization of life, every species are made de novo and independently which is definitely not the case as in reality species speciate (split in two) causing the existence of to two new species. There are tons of fallacies hidden behind the spontaneous generation conception of life, one of which relates to the concept of species and another one is the origin of within population variation.
So, in short spontaneous generation is definitely something different from a single abiogenesis and evolution and the hypothesis of spontaneous generation has been ruled out a long time ago already.
So I am not so much aware of the grading philosophy in your school but your argumentation was wrong and probably the F was worth. Next time, you will probably want to discuss your opinions with your teacher before the test to make sure you agree.