There are several answers, but the most common one is busy work. And I am my own best example.
I am not an academic/research person. I have nothing against those who are, it's just not my thing. One of my career goals was to die unpublished. I didn't ever want my name in any journal, anywhere.
But when I was doing my fellowship, the chairman was of the opinion that it was critically important that everyone get published at some point, regardless of the quality of the research involved. So he came up with an absolutely bullshit project for me. And I was faced with the options of doing it or failing the fellowship.
So I did the project. It was remarkably stupid and pointless. it consisted of me reading through MOUNTAINS of old charts, going back several years, and making notes. For the record, a lot of BS research is done this way. Some poor sucker in training is forced to tediously analyze endless piles of old charts or videos or patient forms or something, to come up with worthless information, under the threat of failing out of their program.
Let's face it. You can get pointless data out of anything: "Our chart review found that people who saw the original release of The Wizard of Oz in 1939 were more likely to have Alzheimer's disease in 2009 then those who'd seen the original release of Star Wars in 1977. This suggests an unidentified risk factor for dementia in seeing MGM films vs. those made by 20th Century Fox."
And these studies are generally cheap to do, because you're already paying the salary of the resident or fellow involved (even cheaper for med students, since they work for brownie points).
And there's always a crappy journal out there, trying to get advertising dollars and willing to publish anything to get readers.
So I found some meaningless data, and at a weekly division meeting I presented it. There were 4 attending physicians and 2 fellows in my subspecialty at the time. 3 of the attendings, and both of the fellows (including me) agreed the paper and it's findings were meaningless drivel.
Unfortunately, the only person who disagreed was the chairman. And since he was editor at the time of some desperate medical journal, he got my paper published there.
To make matters worse, he then got me a poster spot at the annual neurology meeting that year. So I had to go to this meeting, set up a poster with my worthless data on it and then STAND BY IT wearing a badge that identified me as the author.
So for the required 2 hours I stood there, trying to smile at all the big league academics going by. Most looked at my poster and politely didn't say a word. A few gave me sympathetic looks. 3 made comments about how worthless it was (I silently agreed). Only one said something kind.
I left the poster hanging in the meeting hall. I think I was the only person who didn't take theirs home. I assume it's in a landfill by now.
My shitty article got published a few months later, and several intelligent neurologists (who I assume were reading in a hot tub) found my paper to be such absolute garbage that they felt the need to write to the journal to complain. And the journal editor, my chairman, forwarded the letters to me to write a rebuttal.
How do you defend the indefensible? Hell, I agreed with them.
But by this point I'd completed the fellowship, and was an attending physician. And I didn't care. So I just tossed his requests in the trash.
So my sole contribution to the medical literature is out there. Fortunately, as the years go by, it will continually be buried under newer (though equally worthless) data.
And that's where at least some crappy research comes from. And I suspect most of it has similar origins. Some poor sap who's under pressure to publish something, anything, regardless of how stupid or obvious it is, or people trying to pad their resume, or someone with way too much time on their hands and absolutely no life (if you're in the last category, get a dog. Or join Facebook. Or do ANYTHING to waste your time in a more useful way), and crappy journals willing to publish anything.
And that's the way it is.