What you are looking for are the Null mods; SC has made the
Null Spells one, and I did the
Null Items mod (if you want to restrict items as well as spells).
These mods do absolutely nothing by default, but have all the paths/research levels set, so it is relatively straightforward to change something. If you want to restrict spells to level 2 of research, do a simple Find & Replace on "researchlevel 3", "researchlevel 4"... through "researchlevel 9", replacing them all by "researchlevel -1" (I think it is -1 to disable the spell).