When food rots, some microbes can release sulphur dioxide from sulphur-containing amino acids. Being able to smell that reaction product at ridiculously low concentrations will help you steer clear of rotten food. Removing that receptor or reducing their numbers could have been disadvantageous millions of years ago, so that’s why we kept that feature.