Here's the rule in question. Note that before the pine tar game, the rule did not specify a penalty,
only that the bat had to be removed from the game. However, a ball hit with an illegal bat has always been very clearly stated in the rules as an illegally batted ball. Which is an out. Billy Martin knew that, and waited for the next good time to appeal it. It isn't a coincidence they did it after a home run and not a fly ball or ground out.
After the shit show in 1983 they added language that just went ahead and said you get tossed for the illegal bat regardless of whether you hit with it or not, which is in the notes.