Well, in RBY it was because Sonicboom deals a set amount of damage (20) and thus ignores type relations completely. It just didn't occur to the game designers that set-damage moves that don't respect weaknesses or resistances should respect immunities. For the same reason, Seismic Toss works on Ghosts and Night Shade works on Normals.
I seem to recall Sonicboom working on Ghost-types even in GSC, though, when Seismic Toss doesn't. Am I right? If so, it's probably because it's not a contact move. Idunno.