Lots of people consider speculation to be undesirable, and there are two perspectives.
From the investor perspective, speculation is often considered to be frivolous, which may or may not be true. If markets are efficient, then you shouldn’t be jumping in and out of markets except with your own consumption or liabilities or risk tolerance changes. So some people say that speculating is mindless trading because they think efficient markets can’t reward that. In fact, as long as research shows that there is a rational reason for positive expectation (momentum, for example), and that there are methods of controlling losses when things change, short term trading is defensible (that does imply that you think markets aren’t efficient, which is a reasonable opinion to have, just make sure you agree with it if you are speculating). However, it is not investing in a company, it is investing in the efficacy of a system (or in some cases, a bet on a trader’s discretionary instincts - which are unlikely to have positive expectation, but I’m not convinced that one has to rule it out).
From the asset issuer point of view, speculation gets a bad rap because it creates volatility. Of course, companies don’t really complain too much when speculation makes the stock go up, but when it goes down, they get all upset that speculators are driving the stock below intrinsic value. National governments get upset the same way when currency speculation goes against whatever their desires are for a currency. So speculators are a favorite excuse for company managements and national leaders to turn to when prices take a turn in a direction they don’t like. It’s a convenient excuse because it suggests that price changes have nothing to do with the quality of the assets they represent. This may or may not be true, but it’s rare to see a management step up and say “yeah, we screwed up, and that’s why our price is down,” it’s easier to say “it’s not our fault, it’s those darned speculators,” who (it’s assumed) either don’t know what they are doing, or are trying to manipulate prices for a profit.
Of course, you can say that speculation and the volatility it creates is what creates extra opportunity for investors. This seems reasonable to me. In the futures markets, if you don’t have enough hedgers to balance each side of the trade, the presence of speculators is what allows some hedgers to execute their trades.
Investors don’t have as much of a bad rap because interests are presumably more aligned. The investor wants to see the company perform well over time, as does (presumably) the management. Though if investors change their mind about how management is performing or what future prospects are, then they might suddenly find themselves labeled “speculators.”
I don’t think speculation is bad per se, but it can be inconvenient at times, and of course, just because you are speculating does not mean that you are any good at it. But the same can be said of investing, it’s just slightly less risky because investment assets do have an upward trend as a reward for risk over the long term.