I don't find these studies to be convincing. You give people a pill, they don't know what it is. These people don't know what to expect, they've never taken study drugs before. They're solving some random logic puzzle they've never seen before. "Participants had to work out which items to put into a bag."
Compare to how these drugs are used in reality. Someone takes a drug a number of times and performs a mental task that they do frequently. They can get a lot of practice using a drug. Does a new computer make you more productive on day 1, or does it take a while to get used to it, even if you know it'll help in the long run?
The real problems with these drugs are addiction, side effects, and the phenomenon where you have to take higher doses over time to get the same effect. Telling people "don't try study drugs, they don't even work!" backed up by questionable studies reminds me of DARE, telling people that marijuana will kill you.
Maybe one day we will get a drug that enhances mental function, that works effectively and has no real downsides. I think that could be a great boon to society. I don't think it exists yet though, or that we are even really making any progress.