The sputtering yield of SiO2 has been measured for 150-300 keV N+, Ne+, Ar+ and Kr+ ions by monitoring the secondary electron yield during sputtering through thin SiO2 films on Si. Measurements were performed both in ultrahigh vacuum and in low pressure O2, CO and N2 ambients. The ultrahigh vacuum sputtering yield was found to increase with increasing ion mass and decreasing ion energy in agreement with sputtering theory. Quantitatively, though, considerable deviations were found from a direct proportionality between the sputtering yield and the nuclear energy deposited at an SiO2 surface. Since there is a correlation between these deviations and the electronic energy deposition, it is suggested that the sputtering yield could be enhanced by electronic processes. The sputtering of SiO2 films was found to decrease strongly with increasing O2 partial pressure but no dependence on N2 or CO partial pressure was observed. The reduction in sputtering at O2 exposure is larger the smaller the ion mass and can be as much as almost 50% for N+ ions. Most probably, the sputtering decrease in O2 ambients is due to a replacement of sputtered oxygen atoms from the surface by oxygen from the ambient. For light ions, however, it cannot be ruled out that the apparent sputtering reduction, to a small degree, is caused by a simultaneous oxide growth induced by the ion beam. Finally, it is argued that the dependence of the sputtering reduction on ion mass can be due to preferential sputtering of oxygen and/or ion induced incorporation of oxygen in the surface.