They're trading risk.
Sell to a speculator and you turn an uncertain future into cash right now.
Buy from a speculator and you get to enter the market at the moment of your choice.
It unlocks specialization - house builders can focus on building houses, and corn farmers can focus on growing corn. As soon as they're done with a house / harvest, either a consumer or a speculator buys it and they can focus on producing the next house/crop. Without speculators, they'd have to not only do their value-add, they'd also have to predict the market and hope enough customers show up in future. With speculators, this is significantly mitigated.