Notice the verse's wording:
'Whosoever hath sinned against Me...'
See also Bava Kama 79b in which the Sages explain that a burgular pays twofold as opposed to a robber, because at least the robber shows a uniform disdain for authority, stealing before Gd and men unabashedly. The burgular on the other hand fears men only, stealing with subterfuge, but has no fear of Gd, from which no one can hide.
Rashi says in his commentary on Exodus 32:20 there were different punishments for different levels of sin. People who were warned before witnesses were killed by the sword, as was done by an idolatrous city, (Deut. 13:16). Others who acted before witnesses without warning were killed in a plague, (Ex. 32:35). Others who acted without witness or warning were given the water with the calf's ashes to drink, and had their stomachs burst if they were guilty, like the sotah, (Num. 5:27).
In verse 28, the body count of those slain by the sword is given, at 3000. In verse 35, the plague is described, but we are not told how many perished. Those killed by the calf's water aren't mentioned in the verses of Gd's book at all. We need Chazal to to inform us that such sinners even existed!
I would argue that the erasure of sinners from the Torah occured in varying degrees, dependent upon how delinquent they were in their fear of Gd, specifically as opposed to their fear of man. So I am understanding the concept of 'sinning against Gd' in the verse as sinning only before Gd but not before man, disregarding the Former, yet fearing the latter.
- Those who were warned before witnesses and still sinned were essentially proven 'robbers'. They did not fear Gd, but they showed
that did not fear people either. Thus their deaths are mentioned and
considered in the verses.
- Those who were not warned, but who acted before witnesses were not tried and true. They sinned publicly, but in a way that they
would be acquited of capital punishment. So while they didn't care
who saw them sin (Gd or man), they feared human punishment over
Divine Retribution. So their deaths by plague are mentioned in broad strokes,
but they are not ennumerated as individuals; a partial erasure, as
they did 'sin against Gd', albeit not completely.
- Those who sinned with neither witness nor warning were the burgulars. They feared human punishment, and even feared being seen by
their fellows sinning, yet they had no regard for Gd at all. Having
completely fulfilled 'sinning against Gd', they were completely
erased from the Torah.
Since everyone who sinned in any way was killed, it would stand to reason that anyone who was not punished in this way was not considered to have sinned, at least not in the capacity that their names be erased, so Aaron, the Princes, the Spies, and other named personalities are safe...
Or maybe not! Rashi on Deuteronomy 9:20, where Gd's anger with Aaron is detailed, says that Gd intended to kill Aaron's 4 sons, but that Moses was able to save Elazar and Ithamar with prayer. Perhaps you could interpret blotting out of a name more figuratively as blotting out of a bloodline and legacy. So Aaron's (and perhaps others'), legacies were blotted out, albeit only to an extent in Aaron's case, thanks to Moses' selfless prayer. Leviticus Rabbah 7:1 corroborates this idea.
The above midrash also says that Aaron's named is erased! Throughout the first 5 chapters of Leviticus, Aaron is not mentioned directly by name, only "the sons of Aaron". Moses loving prayer for his brother nullifies this decree at the beginning of Leviticus 6, where at last Aaron is mentioned directly.