I have a different take on this. A confidence interval confronts the sample with a certain probability model. It basically gives a set of parameters, under the model, that are consistent with the sample. Obviously the model is wrong in various respects (as all models are, according to George Box at least), independence and others; the question is whether it is still sensible enough so that it makes sense to think about the underlying reality in terms of the model. An appropriate random sampling method is a device that makes some (but not all) of the model assumptions plausible. In the absence of such a sampling method, one needs to think about whether and how the way the sample was actually collected can affect the conclusions that are made from the confidence interval. The confidence interval itself is a mathematically well defined set of numbers - there's nothing wrong with it. What is the problem is really how this is interpreted and used in practice. There are many procedures for collecting samples that will invalidate the model in critical ways, thus invalidating conclusions (take for example something that was recently discussed on Andrew Gelman's blog, researchers doing animal experiments grabbing whatever mouse comes to their hand from the cage, which systematically will choose mice that move more, and are potentially more healthy and energetic).
However, in other cases even critical appraisal does not throw up clear reasons why a sample might deviate systematically from a proper random sample, and confidence intervals are also interpreted cautiously as potentially imprecise indicators of uncertainty, maybe just for comparing different aspects in a study where the same data collection was used across the board, and then the standard confidence interval may be OK. It's not without risks (there can be problems that the researchers miss), but then model-based reasoning always comes with this kind of risk, even with "proper" random sampling.
Of course what whuber alludes to in their comment to the other answer is also true - there may be a model for the specific non-i.i.d. sampling mechanism that has actually been applied, and this can be used to compute more appropriate confidence intervals in that case.