I'm sure I'm not the only new author who has been perplexed by this "rule".
When both reading, and with writing, I get bored with the constant stream of "he said/she said" (no I don't mean the movie). So I try to insert other words -- shouted, yelled, whispered, called, etcetera. Yet, my editor unfailing removes them. It is, I have come to learn, one of those unerring signs of the amateur -- along with using the names of the characters in the dialog, more on that one in a future post.
So why is strictly sticking to "asked" and "said" a rule for the new author? I have no idea, other than it's just a convention. So every now and then, I slip an alternative back into the dialog.