The difference is semantic. We're all maximizing inter-temporal utility - the enormous degree of subjectivity introduced by attempting to objectively distinguish between investing and speculation makes the practice futile. They're not diametrically opposed, but sit right next to each other on a continuum of acts wherein people sacrifice a certain amount of utility in one time period hoping to realize a greater amount of utility than would have otherwise been possible in another.
What connects a lifetime pension contributor who passively selects mutual/target date funds for his retirement and a guy looking to make his dreams come true by buying calls on tech stocks into Q1 earnings is stupidity. Or, to keep it general, an inter-temporal utility function subject to conditions that, when maximized, leads to behavior we might find 'irrational.'