There are a couple of ways to do this. By default osm2pgsql uses the C tag transforms, which use tag names to decide what data is imported. The C tag transforms do not operate on tag values, only tag names, so what your style file is saying is the tag key "amenity=school" is deleted, but it says nothing about tags with a key of amenity and a value of school.
Postprocessing
Running some simple SQL can remove schools
DELETE FROM planet_osm_point WHERE amenity = 'school';
DELETE FROM planet_osm_polygon WHERE amenity = 'school';
This will remove anything that is a school. It will also remove anything that is a school as well as something else, which you may not want.
Tag transforms
Osm2pgsql lets you specify your own tag transforms, written in Lua. You can find an example Lua transform included with the osm2pgsql repository. This allows you to select what you want to import, but is probably overkill for the case of wanting everything except schools.
Filtering in whatever software you are using to query
Schools don't form a significant percentage of the size of the OSM dataset. You could do a normal import, then in whatever you are using to query the database, don't select schools.