Because you input electrical energy and output mechanical energy (motion of air), just like a motor.
However, a loudspeaker can also act as a generator, as can some motors, if you input sound, you get some (tiny) electrical energy output.
edit, consider an elecetic siren where an electric motor drives a mechanical sound device. That is a speaker of sorts.
But it's all a matter of language and definitions. Obviously a speaker is a generator of sound. Just as a motor is a generator of mechanical energy.