The important distinction is that you can be punished under the law for the intent + consequences of speech. For the fire example, if no one reacted at all to me yelling "Fire!", the state could not go after me. Now, if I caused a stampede or other behavior from those in the theater, I could be sued for various things (manslaughter if someone died, criminal mischief, or disturbing the peace).
It's also the same reason the government can go after mob bosses for hiring a hitman to kill someone. They just said something (like, "take that guy out"), which is just speech. But if the actions that resulted in the speech can be directly connected, you can get in trouble for it.
EDIT: To make clear here, intent and consequences matter here. It's why you rarely see cases against speech brought, as intent must also be clear and provable in court.